planime: Avoid infinite loop in -A.
authorFredrik Tolf <fredrik@dolda2000.com>
Fri, 19 Dec 2014 22:18:56 +0000 (23:18 +0100)
committerFredrik Tolf <fredrik@dolda2000.com>
Fri, 19 Dec 2014 22:18:56 +0000 (23:18 +0100)
planime

diff --git a/planime b/planime
index b6e27cd..27b3eac 100755 (executable)
--- a/planime
+++ b/planime
@@ -94,6 +94,10 @@ while [ "${1:0:1}" = - ]; do
            ;;
        -A)
            while :; do
+               if [ $# -lt 1 ]; then
+                   echo "planime: unterminated argument list" >&2
+                   exit 1
+               fi
                a="$1"
                shift
                if [ "$a" = \; ]; then