about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBart Schaefer <schaefer@zsh.org>2022-11-09 21:48:46 -0800
committerBart Schaefer <schaefer@zsh.org>2022-11-09 21:48:46 -0800
commit8839e969bf8f3f129d0efd8ecd51505610a1f01b (patch)
tree915309c35db1ece85fe5c5ed1b480ad7796ef54e
parent1ba8714a7ac665e661c1b3a716ffe2af73d1e443 (diff)
downloadzsh-8839e969bf8f3f129d0efd8ecd51505610a1f01b.tar.gz
zsh-8839e969bf8f3f129d0efd8ecd51505610a1f01b.tar.xz
zsh-8839e969bf8f3f129d0efd8ecd51505610a1f01b.zip
50929: fix handling of ERR_RETURN bent by 50928.
-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;