@matheusbsbs / matheus-bagliano / commits / 29df2385d0
Fork 0

am: POSIX portability fix

POSIX allows echo without flag to interpret specials such as \n, and we tried to make things portable by using printf instead where it matters. Recently added code to "git am" had unprotected "echo", which was caught by t4014 and Rémi Vanicat. This should fix it. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Apr 18, 2008 at 16:11 UTC 29df2385d09611219c53d07f453794d6146e73a3
1 file changed +1 -1
git-am.sh
+1 -1
@@ -302,7 +302,7 @@ do
302 SUBJECT="$(sed -n '/^Subject/ s/Subject: //p' "$dotest/info")"
303 case "$keep_subject" in -k) SUBJECT="[PATCH] $SUBJECT" ;; esac
304
305 - (echo "$SUBJECT" ; echo ; cat "$dotest/msg") |
305 + (printf '%s\n\n' "$SUBJECT"; cat "$dotest/msg") |
306 git stripspace > "$dotest/msg-clean"
307 ;;
308 esac