about summary refs log tree commit diff
diff options
context:
space:
mode:
-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 5078fa973..0d31840ce 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-03  Andrey Borzenkov  <bor@zsh.org>
 
 	* 21086: Completion/Unix/Command/_rsync: fix module completion,
diff --git a/Src/exec.c b/Src/exec.c
index 1e5a2d0fd..d19c55ad4 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 '