From b5b97925c54c5c8ba09fb1e460f9c8549f18968e Mon Sep 17 00:00:00 2001 From: steve Date: Sun, 6 Oct 1996 15:17:19 +0000 Subject: Fix a problem with sh that conflicts with the -e flag text in the man page. Now this will work correctly: /bin/sh -ec 'false && true; echo hi' Obtained from: VaX#n8 --- bin/sh/eval.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'bin/sh/eval.c') diff --git a/bin/sh/eval.c b/bin/sh/eval.c index cfb0d0b..800fc87 100644 --- a/bin/sh/eval.c +++ b/bin/sh/eval.c @@ -33,7 +33,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: eval.c,v 1.4 1995/09/20 08:30:56 davidg Exp $ + * $Id: eval.c,v 1.5 1996/09/01 10:19:57 peter Exp $ */ #ifndef lint @@ -209,8 +209,11 @@ evaltree(n, flags) break; case NAND: evaltree(n->nbinary.ch1, EV_TESTED); - if (evalskip || exitstatus != 0) + if (evalskip || exitstatus != 0) { + /* don't bomb out on "set -e; false && true" */ + flags |= EV_TESTED; goto out; + } evaltree(n->nbinary.ch2, flags); break; case NOR: -- cgit v1.1