Skip to content

Commit

Permalink
Subshell all piped segments.
Browse files Browse the repository at this point in the history
(Creating new child block before pipe status check: look at parent block.)
  • Loading branch information
landley committed Jan 14, 2023
1 parent c5e7495 commit b61cdb4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion toys/pending/sh.c
Original file line number Diff line number Diff line change
Expand Up @@ -3726,7 +3726,7 @@ static void run_lines(void)
// TODO test background a block: { abc; } &

// If we spawn a subshell, pass data off to child process
if (TT.ff->blk->pipe || !strcmp(s, "(") || (ctl && !strcmp(ctl, "&"))) {
if (TT.ff->blk->next->pipe || !strcmp(s, "(") || (ctl && !strcmp(ctl, "&"))) {
if (!(pp->pid = run_subshell(0, -1))) {

// zap forked child's cleanup context and advance to next statement
Expand Down

0 comments on commit b61cdb4

Please sign in to comment.