summaryrefslogtreecommitdiff
path: root/t/t0028-working-tree-encoding.sh
diff options
context:
space:
mode:
authorDoan Tran Cong Danh <congdanhqx@gmail.com>2019-11-07 02:56:12 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-11-07 06:13:54 (GMT)
commit99b2ba35f5a67dd6308b265a8e4c3a92e2e67221 (patch)
treeaf2b822312472efcb169cddb4d3ab3e9260dae55 /t/t0028-working-tree-encoding.sh
parentda72936f544fec5a335e66432610e4cef4430991 (diff)
downloadgit-99b2ba35f5a67dd6308b265a8e4c3a92e2e67221.zip
git-99b2ba35f5a67dd6308b265a8e4c3a92e2e67221.tar.gz
git-99b2ba35f5a67dd6308b265a8e4c3a92e2e67221.tar.bz2
t0028: eliminate non-standard usage of printf
man 1p printf: In addition to the escape sequences shown in the Base Definitions volume of POSIX.1‐2008, Chapter 5, File Format Notation ('\\', '\a', '\b', '\f', '\n', '\r', '\t', '\v'), "\ddd", where ddd is a one, two, or three-digit octal number, shall be written as a byte with the numeric value specified by the octal number. printf '\xfe\xff' is an extension of some shell. Dash, a popular yet simple shell, do not implement this extension. This wasn't caught by most people running the tests, even though common shells like dash don't handle hex escapes, because their systems don't trigger the NO_UTF16_BOM prereq. But systems with musl libc do; when combined with dash, the test fails. Correct it. Signed-off-by: Doan Tran Cong Danh <congdanhqx@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0028-working-tree-encoding.sh')
-rwxr-xr-xt/t0028-working-tree-encoding.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/t0028-working-tree-encoding.sh b/t/t0028-working-tree-encoding.sh
index 7aa0945..bfc4fb9 100755
--- a/t/t0028-working-tree-encoding.sh
+++ b/t/t0028-working-tree-encoding.sh
@@ -17,7 +17,7 @@ test_lazy_prereq NO_UTF32_BOM '
write_utf16 () {
if test_have_prereq NO_UTF16_BOM
then
- printf '\xfe\xff'
+ printf '\376\377'
fi &&
iconv -f UTF-8 -t UTF-16
}
@@ -25,7 +25,7 @@ write_utf16 () {
write_utf32 () {
if test_have_prereq NO_UTF32_BOM
then
- printf '\x00\x00\xfe\xff'
+ printf '\0\0\376\377'
fi &&
iconv -f UTF-8 -t UTF-32
}