summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2015-10-03 19:40:14 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2015-10-03 19:40:14 -0700
commitb581c3fece76c87ed86ae9fc704d0fcf208a79d3 (patch)
tree5c2e1b98776e7839e162e60524fed9a686f50465 /Src
parentfaeb9555d3c853b019aa30ee1ca62bec3971ce9f (diff)
downloadzsh-b581c3fece76c87ed86ae9fc704d0fcf208a79d3.tar.gz
zsh-b581c3fece76c87ed86ae9fc704d0fcf208a79d3.tar.xz
zsh-b581c3fece76c87ed86ae9fc704d0fcf208a79d3.zip
36766: fix incorrect reset of noerrexit during "if" conditions
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) {
 	    /*