From 2e70a25d463b42f30aa404a22fca4582d660c0ba Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Fri, 1 Aug 2003 14:14:19 +0000 Subject: fix bug with f glob qualifier where an empty spec resulted in an infinite loop --- Src/glob.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Src/glob.c') 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; -- cgit 1.4.1