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

Re: [PATCH] Fix ERR_EXIT behavior in function calls and "always" statements



On Sat, Nov 19, 2022 at 5:39 AM Philippe Altherr
<philippe.altherr@xxxxxxxxx> wrote:
>
> I recommend submitting the 4 patches attached here.

Thanks again.  I'm generally more pleased with this set of patches
because the number of places you had to save/restore this_noerrexit in
the previous go-round seemed intuitively wrong to me.

Each time though, you've removed the NEWS item.  Although we've
established that the behavior it describes was not actually
appropriate, there still has been a change in ERR_EXIT behavior that
probably warrants a mention.  What's the best description of that?

Question for the wider list:  With this patch, anonymous functions
behave like functions with respect to ERR_EXIT.  This is reasonable,
but it does mean that

set -e
{ { false && true } } # does not exit
() { { false && true } } # exits

Are we all OK with this, and either way does it need to be called out
somewhere?  For the record (and per my above remark about NEWS) the
previous behavior was that neither of these would exit.  Frankly I'm
still not certain that the extra level of { } should matter in the
function example.




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