summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorsteve <steve@FreeBSD.org>1996-10-06 15:17:19 +0000
committersteve <steve@FreeBSD.org>1996-10-06 15:17:19 +0000
commitb5b97925c54c5c8ba09fb1e460f9c8549f18968e (patch)
tree0b5e4dc0ee9b0917785a2208aecf20e4b15758c1 /bin
parent77e964b083eef7c180e1ccc521d1f807447e8d48 (diff)
downloadFreeBSD-src-b5b97925c54c5c8ba09fb1e460f9c8549f18968e.zip
FreeBSD-src-b5b97925c54c5c8ba09fb1e460f9c8549f18968e.tar.gz
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 <vax@linkdead.paranoia.com>
Diffstat (limited to 'bin')
-rw-r--r--bin/sh/eval.c7
1 files changed, 5 insertions, 2 deletions
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:
OpenPOWER on IntegriCloud