From: Junio C Hamano Date: Thu, 11 Oct 2012 17:40:36 +0000 (-0700) Subject: test-lib: Fix say_color () not to interpret \a\b\c in the message X-Git-Tag: v1.8.0.1~22^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7bc0911d037f0a144d8c227f58693da0c9c77b2a;p=git test-lib: Fix say_color () not to interpret \a\b\c in the message When running with color disabled (e.g. under prove to produce TAP output), say_color() helper function is defined to use echo to show the message. With a message that ends with "\c", echo is allowed to interpret it as "Do not end the line with LF". Use printf "%s\n" to emit the message literally. Signed-off-by: Junio C Hamano --- diff --git a/t/test-lib.sh b/t/test-lib.sh index c0d04c494a..280b3aa1f7 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -169,7 +169,7 @@ else say_color() { test -z "$1" && test -n "$quiet" && return shift - echo "$*" + printf "%s\n" "$*" } fi