Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/sh PR/43255: Make -n apply to the -c string so sh -n -c ...



details:   https://anonhg.NetBSD.org/src/rev/2658489bbaa0
branches:  trunk
changeset: 343718:2658489bbaa0
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Feb 22 20:03:48 2016 +0000

description:
PR/43255: Make -n apply to the -c string so sh -n -c 'commands' works
as it should. Also, other places where the shell parses strings of
commands are also now controlled by -n (traps, eval, ...)  (from kre)

diffstat:

 bin/sh/eval.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r ce59dd85065c -r 2658489bbaa0 bin/sh/eval.c
--- a/bin/sh/eval.c     Mon Feb 22 20:02:29 2016 +0000
+++ b/bin/sh/eval.c     Mon Feb 22 20:03:48 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: eval.c,v 1.111 2016/01/04 03:00:24 christos Exp $      */
+/*     $NetBSD: eval.c,v 1.112 2016/02/22 20:03:48 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.111 2016/01/04 03:00:24 christos Exp $");
+__RCSID("$NetBSD: eval.c,v 1.112 2016/02/22 20:03:48 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -220,7 +220,8 @@
        setinputstring(s, 1);
 
        while ((n = parsecmd(0)) != NEOF) {
-               evaltree(n, flag);
+               if (nflag == 0)
+                       evaltree(n, flag);
                popstackmark(&smark);
        }
        popfile();



Home | Main Index | Thread Index | Old Index