Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: minor bug with f glob qualifier
- X-seq: zsh-workers 18922
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxxxxx>
- Subject: PATCH: minor bug with f glob qualifier
- Date: Fri, 01 Aug 2003 13:56:00 +0200
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
An empty spec component for the f glob qualifier could cause an
infinite loop in the code. e.g. ls *(f:,755:)
This patch fixes that by making it print an error instead.
Oliver
Index: Src/glob.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/glob.c,v
retrieving revision 1.29
diff -u -r1.29 glob.c
--- Src/glob.c 20 Feb 2003 08:17:48 -0000 1.29
+++ Src/glob.c 1 Aug 2003 11:49:38 -0000
@@ -814,7 +814,7 @@
}
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 @@
yes |= val;
else
no |= val;
- }
+ } else {
+ zerr("invalid mode specification", NULL, 0);
+ return 0;
+ }
} while (end && c != end);
*s = p;
Messages sorted by:
Reverse Date,
Date,
Thread,
Author