git: sh: fix spurious newline slips in backquote expansion

Simon Schubert corecode at crater.dragonflybsd.org
Mon Oct 26 03:40:29 PDT 2009


commit 5b762f1a64d25a6e2e06009ede925a9c5057dc57
Author: Simon Schubert <corecode at dragonflybsd.org>
Date:   Mon Oct 26 11:28:35 2009 +0100

    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>

Summary of changes:
 bin/sh/expand.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/5b762f1a64d25a6e2e06009ede925a9c5057dc57


-- 
DragonFly BSD source repository





More information about the Commits mailing list