Date: Tue, 23 Feb 2016 22:44:01 +0000 (UTC) From: Jilles Tjoelker <jilles@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295937 - in head/bin/sh: . tests/parser Message-ID: <201602232244.u1NMi1uk063430@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jilles Date: Tue Feb 23 22:44:01 2016 New Revision: 295937 URL: https://svnweb.freebsd.org/changeset/base/295937 Log: 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 Added: head/bin/sh/tests/parser/set-v1.0 (contents, props changed) head/bin/sh/tests/parser/set-v1.0.stderr (contents, props changed) Modified: head/bin/sh/input.c head/bin/sh/tests/parser/Makefile Modified: head/bin/sh/input.c ============================================================================== --- head/bin/sh/input.c Tue Feb 23 22:30:45 2016 (r295936) +++ head/bin/sh/input.c Tue Feb 23 22:44:01 2016 (r295937) @@ -242,7 +242,8 @@ again: parsenleft = parselleft; parselleft = 0; } else /* *q == '\n' */ { - parsenleft = q - parsenextc + 1; + q++; + parsenleft = q - parsenextc; parselleft -= parsenleft; } parsenleft--; Modified: head/bin/sh/tests/parser/Makefile ============================================================================== --- head/bin/sh/tests/parser/Makefile Tue Feb 23 22:30:45 2016 (r295936) +++ head/bin/sh/tests/parser/Makefile Tue Feb 23 22:44:01 2016 (r295937) @@ -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> Added: head/bin/sh/tests/parser/set-v1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/parser/set-v1.0 Tue Feb 23 22:44:01 2016 (r295937) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +${SH} <<\EOF +echo one >&2 +set -v +echo two >&2 +echo three >&2 +EOF Added: head/bin/sh/tests/parser/set-v1.0.stderr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/parser/set-v1.0.stderr Tue Feb 23 22:44:01 2016 (r295937) @@ -0,0 +1,5 @@ +one +echo two >&2 +two +echo three >&2 +three
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201602232244.u1NMi1uk063430>