I have found that there is an error in the implementation of the negation statement. Zsh currently fails to print "done" for the following code: set -e > fn() { true; } > ! fn > echo done $? Fixing the negation statement allows a slightly simpler fix for function calls. Instead of my original patch, I recommend submitting the 4 patches attached here. Philippe On Wed, Nov 16, 2022 at 3:40 PM Philippe Altherr wrote: > The attached patch fixes the ERR_EXIT behavior in function calls and > "always" statements. The patch does the following: > > - Revert the following patches, which are based on an unfortunate > misunderstanding of the expected behavior of ERR_EXIT: > - 50929: fix handling of ERR_RETURN bent by 50928. > > - 50928: fix tests for 50897, mention behavior change in NEWS > > - I kept the localoptions fix in one of the tests. > - 50897: nonzero status of complex commands should trigger > ERR_EXIT > > - Add saving and restoring of local_noerrexit in doshfunc in exec.c > - This fixes the ERR_EXIT behavior in function calls. > - Add "this_noerrexit = 1;" at the very end of exectry in loop.c > - This makes "always" statements compliant with the exception 3 of > the POSIX specification of "set -e". > - Add new tests in C03traps.ztst > > Philippe > >