summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/exec.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index e45273e68..a5a235389 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-10-03  Barton E. Schaefer  <schaefer@zsh.org>
+
+	* 36766: Src/exec.c: fix incorrect reset of noerrexit during
+	"if" conditions
+
 2015-10-03  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
 	* 36760: Src/pattern.c: ensure we don't do anything untoward
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) {
 	    /*