From 98e46340867028808e71e7f3373881cb7e5b6764 Mon Sep 17 00:00:00 2001
From: Peter Stephenson
Date: Wed, 30 Mar 2022 09:28:43 +0100
Subject: 49906 (Bart), 49911: Fixes to querying jobs in subshell.
Don't attempt to query invalid job off end of table, resulting in
crashes from $jobtstates.
If background task started in subshell, look at tatsks within subshell
instead of main shell. Document and add test.
---
Src/exec.c | 1 +
1 file changed, 1 insertion(+)
(limited to 'Src/exec.c')
diff --git a/Src/exec.c b/Src/exec.c
index 70cbfc97f..27d49e005 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -1689,6 +1689,7 @@ execpline(Estate state, wordcode slcode, int how, int last1)
execpline2(state, code, how, opipe[0], ipipe[1], last1);
pline_level--;
if (how & Z_ASYNC) {
+ clearoldjobtab();
lastwj = newjob;
if (thisjob == list_pipe_job)
--
cgit 1.4.1