From 29df2385d09611219c53d07f453794d6146e73a3 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 18 Apr 2008 16:11:40 -0700 Subject: am: POSIX portability fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 diff --git a/git-am.sh b/git-am.sh index 6be33d9..851f85e 100755 --- a/git-am.sh +++ b/git-am.sh @@ -302,7 +302,7 @@ do SUBJECT="$(sed -n '/^Subject/ s/Subject: //p' "$dotest/info")" case "$keep_subject" in -k) SUBJECT="[PATCH] $SUBJECT" ;; esac - (echo "$SUBJECT" ; echo ; cat "$dotest/msg") | + (printf '%s\n\n' "$SUBJECT"; cat "$dotest/msg") | git stripspace > "$dotest/msg-clean" ;; esac -- cgit v0.10.2-6-g49f6