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)



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