summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2016-09-25 17:14:24 +0100
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2016-09-25 17:14:24 +0100
commit759e5912fdb783e70b3e0d50fa0bc63e441a848b (patch)
treeb69cda73037f2356711a00ca86ef44890c48a643 /Src/exec.c
parent0f8725beeb6b1273a5064f20ed0dd2c160c2a564 (diff)
downloadzsh-759e5912fdb783e70b3e0d50fa0bc63e441a848b.tar.gz
zsh-759e5912fdb783e70b3e0d50fa0bc63e441a848b.tar.xz
zsh-759e5912fdb783e70b3e0d50fa0bc63e441a848b.zip
39435: Further fix for pgrp of funny pipelines.
Don't set gleader of SUBJOB at the point of creation if the
SUPERJOB has no processes yet.
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 d924148d6..a5086c33c 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -1703,7 +1703,8 @@ execpline(Estate state, wordcode slcode, int how, int last1)
 			    jobtab[list_pipe_job].stat |= STAT_SUPERJOB;
 			    jn->stat |= STAT_SUBJOB | STAT_NOPRINT;
 			    jn->other = pid;
-			    jn->gleader = jobtab[list_pipe_job].gleader;
+			    if (hasprocs(list_pipe_job))
+				jn->gleader = jobtab[list_pipe_job].gleader;
 			}
 			if ((list_pipe || last1) && hasprocs(list_pipe_job))
 			    killpg(jobtab[list_pipe_job].gleader, SIGSTOP);