about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2015-05-06 07:46:15 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2015-05-06 07:46:15 -0700
commitaa34d2f1652f31940534864c1a8ef5404c004638 (patch)
treed5e5d7152f6518dd624b7af686f28650f880e9a8 /Src
parentf29895cc08bc04d9788af4a12523bacbd6e6126a (diff)
downloadzsh-aa34d2f1652f31940534864c1a8ef5404c004638.tar.gz
zsh-aa34d2f1652f31940534864c1a8ef5404c004638.tar.xz
zsh-aa34d2f1652f31940534864c1a8ef5404c004638.zip
35046: unwind cmdstack when erroring out of lexing a parameter expansion in braces
Diffstat (limited to 'Src')
-rw-r--r--Src/lex.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Src/lex.c b/Src/lex.c
index c929bb9ba..5b6d3a69b 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -1345,8 +1345,11 @@ gettokstr(int c, int sub)
 	    break;
     }
   brk:
-    if (errflag)
+    if (errflag) {
+	while(bct-- >= in_brace_param)
+	    cmdpop();
 	return LEXERR;
+    }
     hungetc(c);
     if (unmatched)
 	zerr("unmatched %c", unmatched);