summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2008-09-24 19:19:56 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2008-09-24 19:19:56 +0000
commitd17398b442de23ab999593fb74f082b6f6112a5e (patch)
treee65c8e96d33d0030de091cca2b46e5f9a9588ff0
parent602cc2abe0397a0ad9309fc3306c3dc2b9300c91 (diff)
downloadzsh-d17398b442de23ab999593fb74f082b6f6112a5e.tar.gz
zsh-d17398b442de23ab999593fb74f082b6f6112a5e.tar.xz
zsh-d17398b442de23ab999593fb74f082b6f6112a5e.zip
users/13288: Src/parse.c: don't report parse errors on aborted lines
-rw-r--r--ChangeLog5
-rw-r--r--Src/parse.c14
2 files changed, 13 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 6acf6b46c..6eeb47d7c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-09-24  Peter Stephenson  <p.w.stephenson@ntlworld.com>
+
+	* users/13288: Src/parse.c: don't report parse errors if the
+	line was aborted by spell checking etc.
+
 2008-09-24  Peter Stephenson  <pws@csr.com>
 
 	* 25739: configure.ac: warn about GPL in binary if libgdm
diff --git a/Src/parse.c b/Src/parse.c
index 1b9a561e0..eea68cd8c 100644
--- a/Src/parse.c
+++ b/Src/parse.c
@@ -2205,12 +2205,14 @@ yyerror(int noerr)
     for (t0 = 0; t0 != 20; t0++)
 	if (!t || !t[t0] || t[t0] == '\n')
 	    break;
-    if (t0 == 20)
-	zwarn("parse error near `%l...'", t, 20);
-    else if (t0)
-	zwarn("parse error near `%l'", t, t0);
-    else
-	zwarn("parse error");
+    if (!(histdone & HISTFLAG_NOEXEC)) {
+	if (t0 == 20)
+	    zwarn("parse error near `%l...'", t, 20);
+	else if (t0)
+	    zwarn("parse error near `%l'", t, t0);
+	else
+	    zwarn("parse error");
+    }
     if (!noerr && noerrs != 2)
 	errflag = 1;
 }