Skip to content

Commit 35ec002

Browse files
tboegigitster
authored andcommitted
t9001: avoid non-portable '\n' with sed
t9001 used a '\n' in a sed expression to split one line into two lines, but the usage of '\n' in the "replacement string" is not portable. The '\n' can be used to match a newline in the "pattern space", but otherwise the meaning of '\n' is unspecified in POSIX. - Gnu versions of sed will treat '\n' as a newline character. - Other versions of sed (like /usr/bin/sed under Mac OS X) simply ignore the '\' before the 'n', treating '\n' as 'n'. For reference see: pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html http://www.gnu.org/software/sed/manual/sed.html As the test already requires perl as a prerequisite, use perl instead of sed. Signed-off-by: Torsten Bögershausen <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8ccc4e4 commit 35ec002

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/t9001-send-email.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1342,7 +1342,7 @@ test_cover_addresses () {
13421342
git format-patch --cover-letter -2 -o outdir &&
13431343
cover=`echo outdir/0000-*.patch` &&
13441344
mv $cover cover-to-edit.patch &&
1345-
sed "s/^From:/$header: [email protected]\nFrom:/" cover-to-edit.patch >"$cover" &&
1345+
perl -pe "s/^From:/$header: extra\@address.com\nFrom:/" cover-to-edit.patch >"$cover" &&
13461346
git send-email \
13471347
--force \
13481348
--from="Example <[email protected]>" \

0 commit comments

Comments
 (0)