summaryrefslogtreecommitdiff
path: root/t/helper/test-path-utils.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-04-03 07:05:54 +0200
committerJunio C Hamano <gitster@pobox.com>2025-04-07 14:47:36 -0700
commit2df6710097cf7abe07e4e3b42955cc881ca7aa22 (patch)
tree9a55f30986ef34d65a5f11f9636c4ddbdefcc33c /t/helper/test-path-utils.c
parent7792d326f19bd1386600975d97f854d17d74c618 (diff)
t: adapt character translation helpers to not use Perl
We have a couple of helper functions that translate characters, e.g. from LF to NUL or NUL to 'Q' and vice versa. These helpers use Perl scripts, but they can be trivially adapted to instead use tr(1). Note that one specialty here is the handling of NUL characters in tr(1), which historically wasn't implemented correctly on all platforms. But quoting tr(1p): It was considered that automatically stripping NUL characters from the input was not correct functionality. However, the removal of -n in a later proposal does not remove the requirement that tr correctly process NUL characters in its input stream. So when tr(1) is implemented following the POSIX standard then it is expected to handle the transliteration of NUL just fine. Refactor the helpers accordingly, which allows a bunch of tests to pass when Perl is not available. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/helper/test-path-utils.c')
0 files changed, 0 insertions, 0 deletions