fish-shell/tests/checks/nuls.fish
Fabian Boehm c7b43b3abf Truncate builtin arguments on NUL
This restores the status quo where builtins are like external commands
in that they can't see anything after a 0x00, because that's the c-style
string terminator.
2023-06-24 21:26:44 +02:00

13 lines
285 B
Fish

#RUN: %fish %s
# NUL-handling
# This one actually prints a NUL
echo (printf '%s\x00' foo bar | string escape)
# CHECK: foo\x00bar\x00
# This one is truncated
echo foo\x00bar | string escape
# CHECK: foo
# This one is just escaped
echo foo\\x00bar | string escape
# CHECK: foo\\x00bar