about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2017-04-04 18:54:10 +0100
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2017-04-04 18:54:10 +0100
commit8b5102ccf5f5b240ab35646c2d72a22c32c4b916 (patch)
tree249ce0d5b66d3e24d3285006c27a9ab4225d111b
parentf6ab9a281dde719e180809db52d0d142d0c0a240 (diff)
downloadzsh-8b5102ccf5f5b240ab35646c2d72a22c32c4b916.tar.gz
zsh-8b5102ccf5f5b240ab35646c2d72a22c32c4b916.tar.xz
zsh-8b5102ccf5f5b240ab35646c2d72a22c32c4b916.zip
40933: Ensure we get job text in sourced files.
This was turned off explicitly as it was assumed not to be needed,
but it is when code in a sourced file is suspended.

We'll need to see if this makes start up inefficient.
-rw-r--r--ChangeLog5
-rw-r--r--Src/exec.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 221e3dcb9..8543555b8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-04-04  Peter Stephenson  <p.w.stephenson@ntlworld.com>
+
+	* 40933: Src/exec.c: we need job text in sourced files in case
+	of suspending.
+
 2017-04-03  Peter Stephenson  <p.stephenson@samsung.com>
 
 	* 40932: Src/params.c, Test/D06subscript.ztst: parameter
diff --git a/Src/exec.c b/Src/exec.c
index 137130e31..f021a0805 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -1859,7 +1859,7 @@ execpline2(Estate state, wordcode pcode,
 	lineno = WC_PIPE_LINENO(pcode) - 1;
 
     if (pline_level == 1) {
-	if ((how & Z_ASYNC) || (!sfcontext && !sourcelevel))
+	if ((how & Z_ASYNC) || !sfcontext)
 	    strcpy(list_pipe_text,
 		   getjobtext(state->prog,
 			      state->pc + (WC_PIPE_TYPE(pcode) == WC_PIPE_END ?
@@ -3090,7 +3090,7 @@ execcmd_exec(Estate state, Execcmd_params eparams,
 
     /* Get the text associated with this command. */
     if ((how & Z_ASYNC) ||
-	(!sfcontext && !sourcelevel && (jobbing || (how & Z_TIMED))))
+	(!sfcontext && (jobbing || (how & Z_TIMED))))
 	text = getjobtext(state->prog, eparams->beg);
     else
 	text = NULL;