sh: fix spurious newline slips in backquote expansion
authorSimon Schubert <corecode@dragonflybsd.org>
Mon, 26 Oct 2009 10:28:35 +0000 (11:28 +0100)
committerSimon Schubert <simon.schubert@epfl.ch>
Mon, 26 Oct 2009 10:38:00 +0000 (11:38 +0100)
commit5b762f1a64d25a6e2e06009ede925a9c5057dc57
treeef7ddc3de09417f37b4a4177e8204407fbfb9cef
parent5b7608fa99469045afdaab71246a80f2043f0013
sh: fix spurious newline slips in backquote expansion

From FreeBSD revision 1.43:
    Instead of eating trailing newlines after inserting them into the
    output buffer, don't insert them at all.  This prevents a buffer
    *underrun* when the substitution consists completely of newlines
    (e.g. `echo`) and the byte before the source buffer to which p
    points is a '\n', in which case more characters would be removed
    from the output buffer than were inserted.

DragonFly-bug: <http://bugs.dragonflybsd.org/issue1588>
bin/sh/expand.c