diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2005-04-04 09:35:36 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2005-04-04 09:35:36 +0000 |
commit | 82c9c7a42351c5b674153149c761eaa0103cd89e (patch) | |
tree | 963270079d9a7f7ecea5a58f6efebdf2cc0b921a | |
parent | aac33a33a143aefacbea64a803a84327fbc84bde (diff) | |
download | zsh-82c9c7a42351c5b674153149c761eaa0103cd89e.tar.gz zsh-82c9c7a42351c5b674153149c761eaa0103cd89e.tar.xz zsh-82c9c7a42351c5b674153149c761eaa0103cd89e.zip |
21082: Dan Nelson: fix zsh -c exit status on parse error
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Src/exec.c | 2 | ||||
-rw-r--r-- | Test/A01grammar.ztst | 4 |
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 ' |