about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2005-04-04 09:38:20 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2005-04-04 09:38:20 +0000
commit6df44faf120b4abf8bf259a3d50deb1637335e54 (patch)
tree46116dbb8a44da6fa002abee190b5bb204b4f196
parentaf355ed48949dc0c7f46d6bf563b9642da9963a1 (diff)
downloadzsh-6df44faf120b4abf8bf259a3d50deb1637335e54.tar.gz
zsh-6df44faf120b4abf8bf259a3d50deb1637335e54.tar.xz
zsh-6df44faf120b4abf8bf259a3d50deb1637335e54.zip
21082: Dan Nelson: fix zsh -c exit status on parse error
-rw-r--r--ChangeLog5
-rw-r--r--Src/exec.c2
-rw-r--r--Test/A01grammar.ztst4
3 files changed, 11 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index f2ede269e..d25f9fd2d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-04-04  Peter Stephenson  <pws@csr.com>
+
+	* Dan Nelson: 21082: Src/exec.c, Test/A01grammar.ztst: fix zsh -c
+	exit status on parse error.
+
 2005-04-01  Peter Stephenson  <pws@csr.com>
 
 	* 21078: Src/init.c, Test/A01grammar.ztst: parse errors didn't
diff --git a/Src/exec.c b/Src/exec.c
index fb81ba1c2..24355d275 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -162,6 +162,8 @@ parse_string(char *s)
     lineno = 1;
     p = parse_list();
     lineno = oldlineno;
+    if (tok == LEXERR && !lastval)
+	lastval = 1;
     strinend();
     inpop();
     lexrestore();
diff --git a/Test/A01grammar.ztst b/Test/A01grammar.ztst
index 81a963b05..15df464e0 100644
--- a/Test/A01grammar.ztst
+++ b/Test/A01grammar.ztst
@@ -448,3 +448,7 @@
   $ZTST_testdir/../Src/zsh -f <unmatched_quote.txt
 1:Parse error on standard input causes non-zero exit status
 ?zsh: unmatched '
+
+  $ZTST_testdir/../Src/zsh -f -c "'"
+1:Parse error on inline command causes non-zero exit status
+?zsh: unmatched '