From 835572ae23fe57f0ff7c5b61b163148d7ab7b220 Mon Sep 17 00:00:00 2001 From: Andrew Main Date: Tue, 4 Apr 2000 01:16:25 +0000 Subject: 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". --- Src/pattern.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'Src/pattern.c') 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; -- cgit 1.4.1