From abcab533f49395f6de77af6f9b666de8352e7ed7 Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Sun, 23 Nov 2014 15:47:39 -0600 Subject: [PATCH] Fix to make `...` and $(...) command substitution work correctly. This was a 1 -> STDOUT_FILENO change that I missed previously. --- shell/hush.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/hush.c b/shell/hush.c index b8d481e85..210479ac7 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -6172,7 +6172,7 @@ static void xforked_child(void *args_struct) { , SIG_IGN); CLEAR_RANDOM_T(&G.random_gen); /* or else $RANDOM repeats in child */ close(args->channel[0]); /* NB: close _first_, then move fd! */ - xmove_fd(args->channel[1], 1); + xmove_fd(args->channel[1], STDOUT_FILENO); /* Prevent it from trying to handle ctrl-z etc */ IF_HUSH_JOB(G.run_list_level = 1;) /* Awful hack for `trap` or $(trap).