next: fix empty $2 case

This commit is contained in:
bth 2024-01-18 11:01:07 -08:00
commit 0d5b187864

View file

@ -28,13 +28,14 @@ NEXTFILE=`$UMBASEPATH/last.sh | awk -f $UMBASEPATH/next.awk -v arg=$1`
# tag is optional second arg to this script # tag is optional second arg to this script
TAGINSERT='(previous-line) (insert "+ %s\\n") (next-line)' TAGINSERT='(previous-line) (insert "+ %s\\n") (next-line)'
if [ $2 ]; then
# + means insert the string descriptor as tag # + means insert the string descriptor as tag
if [ $2 = '+' ]; then if [ $2 = '+' ]; then
UMTAG=$(printf "$TAGINSERT" "$1") UMTAG=$(printf "$TAGINSERT" "$1")
elif [ $2 ]; then else
UMTAG=$(printf "$TAGINSERT" "$2") UMTAG=$(printf "$TAGINSERT" "$2")
fi fi
fi
# HACK: emacs won't accept piped input as a file name, so we use --eval to open # HACK: emacs won't accept piped input as a file name, so we use --eval to open
# the file via find-file. # the file via find-file.