From 74eeb719fd85a4649c6e9816c99b04e543be5f28 Mon Sep 17 00:00:00 2001 From: Martin Cracauer Date: Fri, 5 Nov 1999 12:06:30 +0000 Subject: [PATCH] When a backquote command inside a here-document had a pipe with more than two processes (got that? :-), the stdin fd of the middle processes that has just been set up was accidetially closed. Don't do this. PR: bin/14527 --- bin/sh/eval.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/sh/eval.c b/bin/sh/eval.c index a3c8fcd2e1e6..701f018fda8b 100644 --- a/bin/sh/eval.c +++ b/bin/sh/eval.c @@ -499,7 +499,8 @@ evalpipe(n) close(prevfd); } if (pip[1] >= 0) { - close(pip[0]); + if (!prevfd > 0) + close(pip[0]); if (pip[1] != 1) { close(1); copyfd(pip[1], 1);