Skip to content

Commit

Permalink
test-lib: Fix say_color () not to interpret \a\b\c in the message
Browse files Browse the repository at this point in the history
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 <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Oct 11, 2012
1 parent d0f1ea6 commit 7bc0911
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion t/test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ else
say_color() {
test -z "$1" && test -n "$quiet" && return
shift
echo "$*"
printf "%s\n" "$*"
}
fi

Expand Down

0 comments on commit 7bc0911

Please sign in to comment.