From 94e09ac041ac7bc9fd52c8bd1d13d1a91da1da6f Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Fri, 11 Mar 2011 19:27:38 -0500 Subject: [ticket/10078] Avoid \n in strings given to echo for portability. Also preserve whitespace (including newlines) when printing the lines that exceed 80 character limit. PHPBB3-10078 --- git-tools/hooks/commit-msg | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'git-tools/hooks') diff --git a/git-tools/hooks/commit-msg b/git-tools/hooks/commit-msg index ad4d69a9da..9114cd368a 100755 --- a/git-tools/hooks/commit-msg +++ b/git-tools/hooks/commit-msg @@ -70,8 +70,9 @@ msg=$(grep -nE '.{81,}' "$1"); if [ $? -eq 0 ] then - echo "The following lines are greater than 80 characters long:\n" >&2; - echo $msg >&2; + echo "The following lines are greater than 80 characters long:" >&2; + echo >&2 + echo "$msg" >&2; quit $ERR_LENGTH; fi -- cgit v1.2.3-65-gdbad