Skip to content

Commit c64368e

Browse files
bk2204gitster
authored andcommitted
t9001: avoid including non-trailing NUL bytes in variables
In this test, we have a command substitution whose output starts with a NUL byte. bash and dash strip out any NUL bytes from the output; zsh does not. As a consequence, zsh fails this test, since the command line argument we use the variable in is truncated by the NUL byte. POSIX says of a command substitution that if "the output contains any null bytes, the behavior is unspecified," so all of the shells are in compliance with POSIX. To make our code more portable, let's avoid prefacing our variables with NUL bytes and instead leave only the trailing one behind. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 5fa0f52 commit c64368e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/t9001-send-email.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2066,7 +2066,7 @@ test_expect_success $PREREQ 'leading and trailing whitespaces are removed' '
20662066
TO1=$(echo "QTo 1 <to1@example.com>" | q_to_tab) &&
20672067
TO2=$(echo "QZto2" | qz_to_tab_space) &&
20682068
CC1=$(echo "cc1" | append_cr) &&
2069-
BCC1=$(echo "Q bcc1@example.com Q" | q_to_nul) &&
2069+
BCC1=$(echo " bcc1@example.com Q" | q_to_nul) &&
20702070
git send-email \
20712071
--dry-run \
20722072
--from=" Example <from@example.com>" \

0 commit comments

Comments
 (0)