about summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Src/exec.c b/Src/exec.c
index 76bd8638a..fc45653e9 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -1963,7 +1963,7 @@ execcmd(Estate state, int input, int output, int how, int last1)
 		    lastval = 0;
 		    return;
 		} else {
-		    cmdoutval = 0;
+		    cmdoutval = lastval;
 		    if (varspc)
 			addvars(state, varspc, 0);
 		    if (errflag)