Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh bug in . builtin
- X-seq: zsh-workers 27086
- From: Eric Blake <ebb9@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: zsh bug in . builtin
- Date: Thu, 2 Jul 2009 12:01:11 +0000 (UTC)
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <4A4B614E.7000406@xxxxxxx> <20090701152420.2beb1c78@news01>
- Sender: news <news@xxxxxxxxxxxxx>
Peter Stephenson <pws <at> csr.com> writes:
> Those are all bugs; it's not supposed to ignore errors even in native mode.
> I've taken 128 to mean failed to execute file, 129 to mean failed to find
> file---anyone can suggest better values if unhappy.
I'd much prefer 127 for a missing file (similar to exec), and something < 127
for syntax error (128 and above should typically be for signals).
Also, you may want to consistently detect syntax errors in eval and in the
action to trap:
$ zsh -c 'eval "if"; echo $?'
0
$ zsh -c 'emulate sh; eval "if"; echo $?'
zsh:1: parse error near `if'
1
$ zsh -c 'trap "if" 0'; echo $?
0
$ zsh -c 'emulate sh; trap "if" 0'; echo $?
zsh:1: parse error near `if'
zsh:trap:1: couldn't parse trap command
1
$ zsh -c 'trap "if" 1; kill -1 $$; echo $?'
0
$ zsh -c 'emulate sh; trap "if" 1; kill -1 $$; echo $?'
zsh:1: parse error near `if'
zsh:trap:1: couldn't parse trap command
$ echo $?
1
Messages sorted by:
Reverse Date,
Date,
Thread,
Author