From 8b5102ccf5f5b240ab35646c2d72a22c32c4b916 Mon Sep 17 00:00:00 2001
From: Peter Stephenson
Date: Tue, 4 Apr 2017 18:54:10 +0100
Subject: 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.
---
ChangeLog | 5 +++++
Src/exec.c | 4 ++--
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
+
+ * 40933: Src/exec.c: we need job text in sourced files in case
+ of suspending.
+
2017-04-03 Peter Stephenson
* 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;
--
cgit v1.2.3-70-g09d2