about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2015-02-27 10:10:19 -0800
committerBarton E. Schaefer <schaefer@zsh.org>2015-02-27 10:10:19 -0800
commit628d2f4f8a4c02b834646a0f601586c55e116510 (patch)
treef60bc3552b172e3740d79ad26729125fb54bdfa1 /Src
parent49776e807f4ab799fca8f78fcf773b093e3e253e (diff)
downloadzsh-628d2f4f8a4c02b834646a0f601586c55e116510.tar.gz
zsh-628d2f4f8a4c02b834646a0f601586c55e116510.tar.xz
zsh-628d2f4f8a4c02b834646a0f601586c55e116510.zip
34634: avoid infinite recursion on (/)# extendedglob
Diffstat (limited to 'Src')
-rw-r--r--Src/glob.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Src/glob.c b/Src/glob.c
index 82f8d626c..33facde2b 100644
--- a/Src/glob.c
+++ b/Src/glob.c
@@ -708,7 +708,8 @@ parsecomplist(char *instr)
 	    }
 	    l1 = (Complist) zhalloc(sizeof *l1);
 	    l1->pat = p1;
-	    l1->closure = 1 + pdflag;
+	    /* special case (/)# to avoid infinite recursion */
+	    l1->closure = (*((char *)p1 + p1->startoff)) ? 1 + pdflag : 0;
 	    l1->follow = 0;
 	    l1->next = parsecomplist(instr);
 	    return (l1->pat) ? l1 : NULL;