summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2017-09-26 09:26:57 +0100
committerPeter Stephenson <pws@zsh.org>2017-09-26 09:26:57 +0100
commit03af5fdbeed0930b5f1d3715ee1080fb993ed145 (patch)
treeff6d9ff8505d7fdd336fe6e5d8291d44b993ca56 /Src
parent7d4b41b52aeabb6f6f95f9bdfdab96b5fd66909a (diff)
downloadzsh-03af5fdbeed0930b5f1d3715ee1080fb993ed145.tar.gz
zsh-03af5fdbeed0930b5f1d3715ee1080fb993ed145.tar.xz
zsh-03af5fdbeed0930b5f1d3715ee1080fb993ed145.zip
41761: Ensure status from interrupt is propagated by builtin
Diffstat (limited to 'Src')
-rw-r--r--Src/exec.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/Src/exec.c b/Src/exec.c
index bd242d140..161d4ac5e 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -3999,8 +3999,15 @@ execcmd_exec(Estate state, Execcmd_params eparams,
 		    state->pc = opc;
 		}
 		dont_queue_signals();
-		if (!errflag)
-		    lastval = execbuiltin(args, assigns, (Builtin) hn);
+		if (!errflag) {
+		    int ret = execbuiltin(args, assigns, (Builtin) hn);
+		    /*
+		     * In case of interruption assume builtin status
+		     * is less useful than what interrupt set.
+		     */
+		    if (!(errflag & ERRFLAG_INT))
+			lastval = ret;
+		}
 		if (do_save & BINF_COMMAND)
 		    errflag &= ~ERRFLAG_ERROR;
 		restore_queue_signals(q);