Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/bin/sh PR/45613: Aleksey Cheusov: /bin/sh: 'set -e' + 'if ev...
details: https://anonhg.NetBSD.org/src/rev/89e8a12ac172
branches: trunk
changeset: 771216:89e8a12ac172
user: christos <christos%NetBSD.org@localhost>
date: Mon Nov 14 18:24:45 2011 +0000
description:
PR/45613: Aleksey Cheusov: /bin/sh: 'set -e' + 'if eval false' problem
Fixed from: http://www.freebsd.org/cgi/query-pr.cgi?pr=134881&cat=
diffstat:
bin/sh/eval.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diffs (43 lines):
diff -r b39ddf160154 -r 89e8a12ac172 bin/sh/eval.c
--- a/bin/sh/eval.c Mon Nov 14 16:21:44 2011 +0000
+++ b/bin/sh/eval.c Mon Nov 14 18:24:45 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: eval.c,v 1.102 2011/08/31 16:24:54 plunky Exp $ */
+/* $NetBSD: eval.c,v 1.103 2011/11/14 18:24:45 christos Exp $ */
/*-
* Copyright (c) 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)eval.c 8.9 (Berkeley) 6/8/95";
#else
-__RCSID("$NetBSD: eval.c,v 1.102 2011/08/31 16:24:54 plunky Exp $");
+__RCSID("$NetBSD: eval.c,v 1.103 2011/11/14 18:24:45 christos Exp $");
#endif
#endif /* not lint */
@@ -92,6 +92,7 @@
STATIC int skipcount; /* number of levels to skip */
MKINIT int loopnest; /* current loop nesting level */
int funcnest; /* depth of function calls */
+STATIC int builtin_flags; /* evalcommand flags for builtins */
const char *commandname;
@@ -181,7 +182,7 @@
STPUTC('\0', concat);
p = grabstackstr(concat);
}
- evalstring(p, 0);
+ evalstring(p, builtin_flags & EV_TESTED);
}
return exitstatus;
}
@@ -1010,6 +1011,7 @@
/* and getopt */
optreset = 1;
optind = 1;
+ builtin_flags = flags;
exitstatus = cmdentry.u.bltin(argc, argv);
} else {
e = exception;
Home |
Main Index |
Thread Index |
Old Index