about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/loop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Src/loop.c b/Src/loop.c
index 41b2e5627..aa733a2cb 100644
--- a/Src/loop.c
+++ b/Src/loop.c
@@ -583,7 +583,7 @@ execif(Estate state, int do_exec)
 	cmdpop();
     } else {
 	noerrexit = olderrexit;
-	if (!retflag)
+	if (!retflag && !errflag)
 	    lastval = 0;
     }
     state->pc = end;