about summary refs log tree commit diff
path: root/Src/glob.c
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2013-09-23 21:02:31 +0100
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2013-09-23 21:02:31 +0100
commit60debf388f65849fc31b92982274cc984da74052 (patch)
tree4812034f99a6508617ea96d45cea449c8f027430 /Src/glob.c
parent8a70a985777031857eb02366a3115e8f6e1f024f (diff)
downloadzsh-60debf388f65849fc31b92982274cc984da74052.tar.gz
zsh-60debf388f65849fc31b92982274cc984da74052.tar.xz
zsh-60debf388f65849fc31b92982274cc984da74052.zip
31764: Dewreakify havoc caused by pattern disables on glob qualifiers.
Don't use the zpc_specials array before it's defined, it's rude.
Diffstat (limited to 'Src/glob.c')
-rw-r--r--Src/glob.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/Src/glob.c b/Src/glob.c
index 9299b95ea..e0d0cf68e 100644
--- a/Src/glob.c
+++ b/Src/glob.c
@@ -1112,7 +1112,8 @@ zglob(LinkList list, LinkNode np, int nountok)
     gf_pre_words = NULL;
 
     /* Check for qualifiers */
-    while (!nobareglob || zpc_special[ZPC_HASH] != Marker) {
+    while (!nobareglob ||
+	   (isset(EXTENDEDGLOB) && !zpc_disables[ZPC_HASH])) {
 	struct qual *newquals;
 	char *s;
 	int sense, paren;
@@ -1158,11 +1159,11 @@ zglob(LinkList list, LinkNode np, int nountok)
 	    case Outpar:
 		paren++; /*FALLTHROUGH*/
 	    case Bar:
-		if (zpc_special[ZPC_BAR] != Marker)
+		if (!zpc_disables[ZPC_BAR])
 		    nobareglob = 1;
 		break;
 	    case Tilde:
-		if (zpc_special[ZPC_TILDE] != Marker)
+		if (isset(EXTENDEDGLOB) && !zpc_disables[ZPC_TILDE])
 		    nobareglob = 1;
 		break;
 	    case Inpar:
@@ -1172,7 +1173,7 @@ zglob(LinkList list, LinkNode np, int nountok)
 	}
 	if (*s != Inpar)
 	    break;
-	if (s[1] == zpc_special[ZPC_HASH]) {
+	if (isset(EXTENDEDGLOB) && !zpc_disables[ZPC_HASH] && s[1] == Pound) {
 	    if (s[2] == 'q') {
 		*s = 0;
 		s += 2;