about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2003-08-01 14:14:19 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2003-08-01 14:14:19 +0000
commit2e70a25d463b42f30aa404a22fca4582d660c0ba (patch)
tree9daf0641c6832fdf3ad482c0c9f1537b9ea8a066
parent280593163d7c53e45a1796f1e31897164a8fa59f (diff)
downloadzsh-2e70a25d463b42f30aa404a22fca4582d660c0ba.tar.gz
zsh-2e70a25d463b42f30aa404a22fca4582d660c0ba.tar.xz
zsh-2e70a25d463b42f30aa404a22fca4582d660c0ba.zip
fix bug with f glob qualifier where an empty spec resulted in an infinite loop
-rw-r--r--ChangeLog2
-rw-r--r--Src/glob.c7
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 63b2af406..676d8ea30 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2003-08-01  Oliver Kiddle  <opk@zsh.org>
 
+	* 189xx: Src/glob.c: fix minor bug with f glob qualifier
+
 	* 18xxx: Completion/Unix/Command/_chmod: new chmod completion
 
 2003-08-01  Peter Stephenson  <pws@csr.com>
diff --git a/Src/glob.c b/Src/glob.c
index 2e65fafc7..5f38ad188 100644
--- a/Src/glob.c
+++ b/Src/glob.c
@@ -814,7 +814,7 @@ qgetmodespec(char **s)
 	    }
 	    if (how == '=' || how == '-')
 		no |= val & mask;
-	} else {
+	} else if (!(end && c == end) && c != ',' && c) {
 	    t = 07777;
 	    while ((c = *p) == '?' || c == Quest ||
 		   (c >= '0' && c <= '7')) {
@@ -838,7 +838,10 @@ qgetmodespec(char **s)
 		yes |= val;
 	    else
 		no |= val;
-	}
+	} else {
+	    zerr("invalid mode specification", NULL, 0);
+	    return 0;
+        }
     } while (end && c != end);
 
     *s = p;