diff options
Diffstat (limited to 'bin/sh')
-rw-r--r-- | bin/sh/input.c | 3 | ||||
-rw-r--r-- | bin/sh/tests/parser/Makefile | 1 | ||||
-rw-r--r-- | bin/sh/tests/parser/set-v1.0 | 8 | ||||
-rw-r--r-- | bin/sh/tests/parser/set-v1.0.stderr | 5 |
4 files changed, 16 insertions, 1 deletions
diff --git a/bin/sh/input.c b/bin/sh/input.c index 27b835a..3292f99 100644 --- a/bin/sh/input.c +++ b/bin/sh/input.c @@ -242,7 +242,8 @@ again: parsenleft = parselleft; parselleft = 0; } else /* *q == '\n' */ { - parsenleft = q - parsenextc + 1; + q++; + parsenleft = q - parsenextc; parselleft -= parsenleft; } parsenleft--; diff --git a/bin/sh/tests/parser/Makefile b/bin/sh/tests/parser/Makefile index bdbd6ca..4f823b0 100644 --- a/bin/sh/tests/parser/Makefile +++ b/bin/sh/tests/parser/Makefile @@ -82,6 +82,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> diff --git a/bin/sh/tests/parser/set-v1.0 b/bin/sh/tests/parser/set-v1.0 new file mode 100644 index 0000000..687cb83 --- /dev/null +++ b/bin/sh/tests/parser/set-v1.0 @@ -0,0 +1,8 @@ +# $FreeBSD$ + +${SH} <<\EOF +echo one >&2 +set -v +echo two >&2 +echo three >&2 +EOF diff --git a/bin/sh/tests/parser/set-v1.0.stderr b/bin/sh/tests/parser/set-v1.0.stderr new file mode 100644 index 0000000..d904fa5 --- /dev/null +++ b/bin/sh/tests/parser/set-v1.0.stderr @@ -0,0 +1,5 @@ +one +echo two >&2 +two +echo three >&2 +three |