1. Stefan Saasen
  2. git


Junio C Hamano  committed 29df238

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>

  • Participants
  • Parent commits 11dc4e7
  • Branches master

Comments (0)

Files changed (1)

File git-am.sh

View file
  • Ignore whitespace
 		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"