git: sh: fix spurious newline slips in backquote expansion

看板DFBSD_commit作者時間16年前 (2009/10/26 19:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
commit 5b762f1a64d25a6e2e06009ede925a9c5057dc57 Author: Simon Schubert <corecode@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
文章代碼(AID): #1AvO5rIX (DFBSD_commit)