about summary refs log tree commit diff
path: root/Src/Zle
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2015-01-18 22:38:57 +0000
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2015-01-18 22:38:57 +0000
commitc6c9f5daf2e196e6ab7346dfbf5f5166a1d87f0c (patch)
treede064fa6ba629549d42868b7016dd3c28bfb0e34 /Src/Zle
parent6856ab39e32e0cba96fcdae004878938125890ac (diff)
downloadzsh-c6c9f5daf2e196e6ab7346dfbf5f5166a1d87f0c.tar.gz
zsh-c6c9f5daf2e196e6ab7346dfbf5f5166a1d87f0c.tar.xz
zsh-c6c9f5daf2e196e6ab7346dfbf5f5166a1d87f0c.zip
34322: bug with interface to parsestr() etc.
Was showing up in places like ${(e)...} where command substitution
could reallocate the token string, but actually there was never any
guarantee that the lexer wouldn't do that, so this was always
a bit iffy.
Diffstat (limited to 'Src/Zle')
-rw-r--r--Src/Zle/compctl.c4
-rw-r--r--Src/Zle/compresult.c3
2 files changed, 4 insertions, 3 deletions
diff --git a/Src/Zle/compctl.c b/Src/Zle/compctl.c
index 43dd4e2a9..189582d22 100644
--- a/Src/Zle/compctl.c
+++ b/Src/Zle/compctl.c
@@ -3853,7 +3853,7 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd)
 	    yaptr = get_user_var(uv);
 	if ((tt = cc->explain)) {
 	    tt = dupstring(tt);
-	    if ((cc->mask & CC_EXPANDEXPL) && !parsestr(tt)) {
+	    if ((cc->mask & CC_EXPANDEXPL) && !parsestr(&tt)) {
 		singsub(&tt);
 		untokenize(tt);
 	    }
@@ -3873,7 +3873,7 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd)
 	}
     } else if ((tt = cc->explain)) {
 	tt = dupstring(tt);
-	if ((cc->mask & CC_EXPANDEXPL) && !parsestr(tt)) {
+	if ((cc->mask & CC_EXPANDEXPL) && !parsestr(&tt)) {
 	    singsub(&tt);
 	    untokenize(tt);
 	}
diff --git a/Src/Zle/compresult.c b/Src/Zle/compresult.c
index dbef7f841..9f383f4b8 100644
--- a/Src/Zle/compresult.c
+++ b/Src/Zle/compresult.c
@@ -1090,7 +1090,8 @@ do_single(Cmatch m)
 		    }
 		    if (tryit) {
 			noerrs = 1;
-			parsestr(p);
+			p = dupstring(p);
+			parsestr(&p);
 			singsub(&p);
 			errflag &= ~ERRFLAG_ERROR;
 			noerrs = ne;