Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] More ERR_EXIT (was Re: Tests RE behavior of ERR_EXIT)
- X-seq: zsh-workers 50946
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Philippe Altherr <philippe.altherr@xxxxxxxxx>
- Cc: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] More ERR_EXIT (was Re: Tests RE behavior of ERR_EXIT)
- Date: Sat, 12 Nov 2022 20:11:01 -0800
- Archived-at: <https://zsh.org/workers/50946>
- In-reply-to: <CAGdYchu66aYu+3yzYGtMnNcT6GcWziWe9YWNqOv5_T=JpCynRg@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAGdYchsPpEMNwWFtukBS1ZzWob_hZOm8Mnnmp9Uey2T4pWs63g@mail.gmail.com> <CAGdYchu66aYu+3yzYGtMnNcT6GcWziWe9YWNqOv5_T=JpCynRg@mail.gmail.com>
On Sat, Nov 12, 2022 at 7:59 PM Philippe Altherr
<philippe.altherr@xxxxxxxxx> wrote:
>
> - The problem seems to be related to how "false && true" interacts with other constructs.
> - In Zsh 5.9 the problem seems to be that compound commands now incorrectly trigger ERR_EXIT.
> - In Zsh 5.8 I can't pinpoint the problem, for now.
You shouldn't even be bothering with 5.8.1, it's been wrong all along;
it blindly never errexits at the end of an if/then/fi.
I think my patches so far have uncovered a different bug that was
already present but was masked by the foregoing, which is, that
noerrexit is unwound in cases where it should not be. I think this is
happening at lines 1530-1531 of exec.c, right under the comment about
"hairy code near the end of execif()". That's an area I didn't touch,
but I'm pretty sure it's restoring noerrexit to its state before
entering the "if" (oldnoerrexit) when it should be preserving the
state from the "&&" conditional. In 5.8.1 this gets reversed again
via this_noerrexit.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author