about summary refs log tree commit diff
path: root/Src/pattern.c
diff options
context:
space:
mode:
authorAndrew Main <zefram@users.sourceforge.net>2000-04-04 01:16:25 +0000
committerAndrew Main <zefram@users.sourceforge.net>2000-04-04 01:16:25 +0000
commit835572ae23fe57f0ff7c5b61b163148d7ab7b220 (patch)
tree987223b277d3ef2b664c65b37d99709d30b45964 /Src/pattern.c
parent2aa3419a283a07dc7547956e93c3ef7f8b35e109 (diff)
downloadzsh-835572ae23fe57f0ff7c5b61b163148d7ab7b220.tar.gz
zsh-835572ae23fe57f0ff7c5b61b163148d7ab7b220.tar.xz
zsh-835572ae23fe57f0ff7c5b61b163148d7ab7b220.zip
10444: Src/lex.c, Src/pattern.c: Insist on proper syntax
for numeric globbing (with the "-").  Also fix the bug whereby
"echo 1<2-3>" would lose the "1".
Diffstat (limited to 'Src/pattern.c')
-rw-r--r--Src/pattern.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/Src/pattern.c b/Src/pattern.c
index 914479847..d70c5c1d9 100644
--- a/Src/pattern.c
+++ b/Src/pattern.c
@@ -989,14 +989,13 @@ patcomppiece(int *flagp)
 		patparse = nptr;
 		len |= 1;
 	    }
-	    if (*patparse == '-') {
-		patparse++;
-		if (idigit(*patparse)) {
-		    to = (zrange_t) zstrtol((char *)patparse,
-					      (char **)&nptr, 10);
-		    patparse = nptr;
-		    len |= 2;
-		}
+	    DPUTS(*patparse != '-', "BUG: - missing from numeric glob");
+	    patparse++;
+	    if (idigit(*patparse)) {
+		to = (zrange_t) zstrtol((char *)patparse,
+					  (char **)&nptr, 10);
+		patparse = nptr;
+		len |= 2;
 	    }
 	    if (*patparse != Outang)
 		return 0;