about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--Src/lex.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 75ed142af..dddd2291c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2015-03-27  Barton E. Schaefer  <schaefer@zsh.org>
+
+	* 34788: Src/lex.c: refine errflag handling in cmd_or_math()
+
 2015-03-27  Peter Stephenson  <p.stephenson@samsung.com>
 
 	* Han Pingtian: 34785: Doc/Zsh/options.yo: fix typo in SHINSTDIN.
diff --git a/Src/lex.c b/Src/lex.c
index 6d0079c8f..4d8355bac 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -513,7 +513,7 @@ cmd_or_math(int cs_type)
     /* else unsuccessful: unget the whole thing */
     hungetc(c);
     lexstop = 0;
-    while (lexbuf.len > oldlen && !errflag) {
+    while (lexbuf.len > oldlen && !(errflag & ERRFLAG_ERROR)) {
 	lexbuf.len--;
 	hungetc(itok(*--lexbuf.ptr) ?
 		ztokens[*lexbuf.ptr - Pound] : *lexbuf.ptr);