Module Name: src
Committed By: christos
Date: Mon Feb 22 20:03:48 UTC 2016
Modified Files:
src/bin/sh: eval.c
Log Message:
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)
To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.112 src/bin/sh/eval.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/bin/sh/eval.c
diff -u src/bin/sh/eval.c:1.111 src/bin/sh/eval.c:1.112
--- src/bin/sh/eval.c:1.111 Sun Jan 3 22:00:24 2016
+++ src/bin/sh/eval.c Mon Feb 22 15:03:48 2016
@@ -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 @@ evalstring(char *s, int flag)
setinputstring(s, 1);
while ((n = parsecmd(0)) != NEOF) {
- evaltree(n, flag);
+ if (nflag == 0)
+ evaltree(n, flag);
popstackmark(&smark);
}
popfile();