summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/lex.c6
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 98b419eca..1d95e81fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-05-15  Peter Stephenson  <p.w.stephenson@ntlworld.com>
+
+	*  35155: Src/lex.c: cmdpop() could sometimes get called too
+	often on error.
+
 2015-05-15  Oliver Kiddle  <opk@zsh.org>
 
 	* users/20219: Completion/Unix/Command/_git: fix for git options
diff --git a/Src/lex.c b/Src/lex.c
index 5b6d3a69b..841fb0b86 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -1346,8 +1346,10 @@ gettokstr(int c, int sub)
     }
   brk:
     if (errflag) {
-	while(bct-- >= in_brace_param)
-	    cmdpop();
+	if (in_brace_param) {
+	    while(bct-- >= in_brace_param)
+		cmdpop();
+	}
 	return LEXERR;
     }
     hungetc(c);