Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: ERR_RETURN doc



The following script prints "done 1"

set -e
false && true
echo done $?

If a statement followed by an always-block always behaves as if the always-block wasn't there, then the following script should print the same (after "ALWAYS")

set -e
{ false && true } always { echo ALWAYS }
echo done $?

The current Zsh only prints "ALWAYS", while the patched one prints "ALWAYS" followed by "done 1". So I guess that even the always patch can be qualified as a bug fix.

Philippe


On Thu, Dec 1, 2022 at 9:05 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
On Thu, Dec 1, 2022 at 11:30 AM Philippe Altherr
<philippe.altherr@xxxxxxxxx> wrote:
>
> The patch about the always statement makes it behave like compound statements.

A statement followed by an always-block should always behave as if the
always-block wasn't there, except in the TRY_BLOCK_ERROR cases
mentioned in the description of "always".  I suppose your patches
should be tested against that.


Messages sorted by: Reverse Date, Date, Thread, Author