about summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2017-09-27 20:34:11 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2017-09-27 20:34:11 -0700
commit7a0718796a56be64b5498806b4d8491ef2f9bb7d (patch)
tree5ca040b832bb08ba2aeeb19cfc23e76cdba34567 /Src/exec.c
parent6230e82d44da25773437c5438c83a5d5fe275420 (diff)
downloadzsh-7a0718796a56be64b5498806b4d8491ef2f9bb7d.tar.gz
zsh-7a0718796a56be64b5498806b4d8491ef2f9bb7d.tar.xz
zsh-7a0718796a56be64b5498806b4d8491ef2f9bb7d.zip
41767: preserve nonzero exit status on interrupt
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Src/exec.c b/Src/exec.c
index 161d4ac5e..0d2dc4ebb 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -3199,7 +3199,8 @@ execcmd_exec(Estate state, Execcmd_params eparams,
     }
 
     if (errflag) {
-	lastval = 1;
+	if (!lastval)
+	    lastval = 1;
 	if (oautocont >= 0)
 	    opts[AUTOCONTINUE] = oautocont;
 	return;