Improve sed portability
authorChris Ridd <chris.ridd@isode.com>
Wed, 11 Jun 2008 13:09:19 +0000 (14:09 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 13 Jun 2008 05:20:18 +0000 (22:20 -0700)
The behaviour of "sed" on an incomplete line is unspecified by POSIX, and
On Solaris it apparently fails to process input that doesn't end in a LF.

Consequently constructs like

re=$(printf '%s' foo | sed -e 's/bar/BAR/g' $)

cause re to be set to the empty string. Such a construct is used in
git-submodule.sh.

Because the LF at the end of command output are stripped away by the
command substitution, it is a safe and sane change to add a LF at the end
of the printf format specifier.

Signed-off-by: Chris Ridd <chris.ridd@isode.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
No differences found