about summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c2
1 files changed, 1 insertions, 1 deletions
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;