about summary refs log tree commit diff
path: root/Src/loop.c
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2016-11-05 13:54:16 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2016-11-05 13:54:16 -0700
commit2c56c7e5e809476fc6511a9e634d2a977593ef9e (patch)
tree00dc80fc97d4b085ef38f00ff7902352564acec5 /Src/loop.c
parentd91ffb1db2784c3ff17d93db8d1fe38816fc5129 (diff)
downloadzsh-2c56c7e5e809476fc6511a9e634d2a977593ef9e.tar.gz
zsh-2c56c7e5e809476fc6511a9e634d2a977593ef9e.tar.xz
zsh-2c56c7e5e809476fc6511a9e634d2a977593ef9e.zip
39839: fix "return" from "if" condition
Diffstat (limited to 'Src/loop.c')
-rw-r--r--Src/loop.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Src/loop.c b/Src/loop.c
index b791a898d..f65c72bf4 100644
--- a/Src/loop.c
+++ b/Src/loop.c
@@ -570,7 +570,8 @@ execif(Estate state, int do_exec)
 	cmdpop();
     } else {
 	noerrexit = olderrexit;
-	lastval = 0;
+	if (!retflag)
+	    lastval = 0;
     }
     state->pc = end;