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 Wed, Nov 9, 2022 at 9:22 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> Grateful for the thorough regression tests in E01options, too.

Of course I still missed one detail ... ERR_RETURN only applies inside
functions.

diff --git a/Src/exec.c b/Src/exec.c
index eef40232e..ce0c1f1ad 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -1442,7 +1442,7 @@ execlist(Estate state, int dont_change_job, int exiting)
             execsimple(state);
         else
             execpline(state, code, ltype, (ltype & Z_END) && exiting);
-        if (unset(ERRRETURN))
+        if (!locallevel || unset(ERRRETURN))
             this_noerrexit = noerrexit;
         state->pc = next;
         goto sublist_done;




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