Skip to contentSkip to conversation

t9001: avoid not portable '\n' with sed

PATCH Superseded Torsten Bögershausen 1 participant 1 message Jun 15, 2016

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 t9001: avoid not portable '\n' with sed

t9001 used a '\n' in a sed expression to split one line into two lines. Some versions of sed (/usr/bin/sed under Mac OS X)
simply ignore the '\' before the 'n', treating '\n' as 'n'.

As the test already requires perl as a prerequisite, use perl instead of sed.

---
 t/t9001-send-email.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
t/t9001-send-email.sh +1 -1
index 64d9434..19a3ced 100755
@@ -1342,7 +1342,7 @@ test_cover_addresses () {
 	git format-patch --cover-letter -2 -o outdir &&
 	cover=`echo outdir/0000-*.patch` &&
 	mv $cover cover-to-edit.patch &&
-	sed "s/^From:/$header: [email protected]\nFrom:/" cover-to-edit.patch >"$cover" &&
+	perl -pe "s/^From:/$header: extra\@address.com\nFrom:/" cover-to-edit.patch >"$cover" &&
 	git send-email \
 	  --force \
 	  --from="Example <[email protected]>" \
Signature · 1 line
2.0.0.553.ged01b91