sh: Fix set -v and multiline history after r295825.

r295825 erroneously dropped the newline from the input data for 'set -v'
output and multiline history.

Reported by:	vangyzen
This commit is contained in:
Jilles Tjoelker 2016-02-23 22:44:01 +00:00
parent 3e4f6cc6c7
commit 84f1891033
4 changed files with 16 additions and 1 deletions

View File

@ -242,7 +242,8 @@ again:
parsenleft = parselleft;
parselleft = 0;
} else /* *q == '\n' */ {
parsenleft = q - parsenextc + 1;
q++;
parsenleft = q - parsenextc;
parselleft -= parsenleft;
}
parsenleft--;

View File

@ -79,6 +79,7 @@ FILES+= only-redir2.0
FILES+= only-redir3.0
FILES+= only-redir4.0
FILES+= pipe-not1.0
FILES+= set-v1.0 set-v1.0.stderr
FILES+= var-assign1.0
.include <bsd.test.mk>

View File

@ -0,0 +1,8 @@
# $FreeBSD$
${SH} <<\EOF
echo one >&2
set -v
echo two >&2
echo three >&2
EOF

View File

@ -0,0 +1,5 @@
one
echo two >&2
two
echo three >&2
three