summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--Src/exec.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index d88fa4cbb..6478f5480 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
2022-11-09 Bart Schaefer <schaefer@zsh.org>
+ * 50929: Src/exec.c: fix handling of ERR_RETURN bent by 50928.
+
* 50928: News, Src/exec.c, Test/C03traps.ztst: fix tests for 50897,
mention behavior change in NEWS
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;