]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t/t9902-completion.sh: backslashes in echo
authorMarcel Telka <marcel@telka.sk>
Fri, 17 May 2024 14:08:45 +0000 (16:08 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 17 May 2024 19:13:26 +0000 (12:13 -0700)
The usage of backslashes in echo is not portable.  Since some tests
tries to output strings containing '\b' it is safer to use printf
here.  The usage of printf instead of echo is also preferred by POSIX.

Signed-off-by: Marcel Telka <marcel@telka.sk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t9902-completion.sh

index 963f865f27ed0589600d780745ff09865a2f9c7e..ed3d03367ec6c2148a72001ce9aca3703dacfc36 100755 (executable)
@@ -73,7 +73,7 @@ _get_comp_words_by_ref ()
 print_comp ()
 {
        local IFS=$'\n'
-       echo "${COMPREPLY[*]}" > out
+       printf '%s\n' "${COMPREPLY[*]}" > out
 }
 
 run_completion ()