path: root/t/
diff options
authorbrian m. carlson <>2019-11-27 19:01:42 (GMT)
committerJunio C Hamano <>2019-11-30 22:00:33 (GMT)
commitc64368e3a2a4749d71b703ae31dee6e451a80f54 (patch)
tree1623f33733412f6f082fbff820503dd72b4808bd /t/
parent5fa0f5238b0cd46cfe7f6fa76c3f526ea98148d9 (diff)
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 <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 't/')
1 files changed, 1 insertions, 1 deletions
diff --git a/t/ b/t/
index 997f90b..51be0b8 100755
--- a/t/
+++ b/t/
@@ -2066,7 +2066,7 @@ test_expect_success $PREREQ 'leading and trailing whitespaces are removed' '
TO1=$(echo "QTo 1 <>" | q_to_tab) &&
TO2=$(echo "QZto2" | qz_to_tab_space) &&
CC1=$(echo "cc1" | append_cr) &&
- BCC1=$(echo "Q Q" | q_to_nul) &&
+ BCC1=$(echo " Q" | q_to_nul) &&
git send-email \
--dry-run \
--from=" Example <>" \