diff options
author | Kevin Daudt <me@ikke.info> | 2019-02-11 22:38:18 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-02-11 23:46:36 +0100 |
commit | 99e9ab54aba21b8fa368f20e6b3585d95b1c4d37 (patch) | |
tree | d4029e5af1e692e576ed616e6b9c3f80fbbab895 /t/t0028-working-tree-encoding.sh | |
parent | Git 2.18.1 (diff) | |
download | git-99e9ab54aba21b8fa368f20e6b3585d95b1c4d37.tar.xz git-99e9ab54aba21b8fa368f20e6b3585d95b1c4d37.zip |
t0028: fix wrong octal values for BOM in setup
The setup code uses octal values with printf to generate a BOM for
UTF-16/32 BE/LE. It specifically uses '\777' to emit a 0xff byte. This
relies on the fact that most shells truncate the value above 0o377.
Ash however interprets '\777' as '\77' + a literal '7', resulting in an
invalid BOM.
Fix this by using the proper value of 0xff: '\377'.
Signed-off-by: Kevin Daudt <me@ikke.info>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '')
-rwxr-xr-x | t/t0028-working-tree-encoding.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/t/t0028-working-tree-encoding.sh b/t/t0028-working-tree-encoding.sh index 12b8eb963a..58e5b6cdd4 100755 --- a/t/t0028-working-tree-encoding.sh +++ b/t/t0028-working-tree-encoding.sh @@ -22,12 +22,12 @@ test_expect_success 'setup test files' ' # BOM tests printf "\0a\0b\0c" >nobom.utf16be.raw && printf "a\0b\0c\0" >nobom.utf16le.raw && - printf "\376\777\0a\0b\0c" >bebom.utf16be.raw && - printf "\777\376a\0b\0c\0" >lebom.utf16le.raw && + printf "\376\377\0a\0b\0c" >bebom.utf16be.raw && + printf "\377\376a\0b\0c\0" >lebom.utf16le.raw && printf "\0\0\0a\0\0\0b\0\0\0c" >nobom.utf32be.raw && printf "a\0\0\0b\0\0\0c\0\0\0" >nobom.utf32le.raw && - printf "\0\0\376\777\0\0\0a\0\0\0b\0\0\0c" >bebom.utf32be.raw && - printf "\777\376\0\0a\0\0\0b\0\0\0c\0\0\0" >lebom.utf32le.raw && + printf "\0\0\376\377\0\0\0a\0\0\0b\0\0\0c" >bebom.utf32be.raw && + printf "\377\376\0\0a\0\0\0b\0\0\0c\0\0\0" >lebom.utf32le.raw && # Add only UTF-16 file, we will add the UTF-32 file later cp test.utf16.raw test.utf16 && |