summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/exec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Src/exec.c b/Src/exec.c
index 154bbb8db..235faf3ba 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -1364,7 +1364,8 @@ sublist_done:
 	 * we hit execcmd on the way down.  We're now
 	 * on the way back up, so don't restore it.
 	 */
-	noerrexit = (oldnoerrexit == 2) ? 0 : oldnoerrexit;
+	if (oldnoerrexit != 2)
+	    noerrexit = oldnoerrexit;
 
 	if (sigtrapped[SIGDEBUG] && !isset(DEBUGBEFORECMD) && !donedebug) {
 	    /*