sh: Honour -n while processing -c string.

This commit is contained in:
Jilles Tjoelker 2011-06-04 11:28:42 +00:00
parent 564a091bd2
commit 9338c85c31
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=222676
2 changed files with 4 additions and 1 deletions

View File

@ -165,7 +165,7 @@ evalstring(char *s, int flags)
setstackmark(&smark);
setinputstring(s, 1);
while ((n = parsecmd(0)) != NEOF) {
if (n != NULL) {
if (n != NULL && !nflag) {
if (flags_exit && preadateof())
evaltree(n, flags | EV_EXIT);
else

View File

@ -0,0 +1,3 @@
# $FreeBSD$
$SH -nc 'echo bad'