Isolate hack for skipping internal separator

stage_wildcards has no need for INTERNAL_SEPARATOR. Remove it already
at this stage, to avoid the need to have the workaround in the generic
decoding routine.

Unfortunately we still can't add assert!(!fish_reserved_codepoint(c));
to wcs2bytes_callback, since builtin printf still passes arbitrary
characters. We should fix that later.

Test that printf now behaves correctly for INTERNAL_SEPARATOR.
Also add a regression test for 0c9b73e317.
This commit is contained in:
Johannes Altmanninger
2025-12-17 16:43:16 +01:00
parent ee2d99ecf3
commit 50bcc3cf4f
4 changed files with 20 additions and 11 deletions

View File

@@ -630,6 +630,9 @@ $fish -c 'echo \ufdd2"fart"'
echo (printf '\ufdd2foo') | string escape
# CHECK: \Xef\Xb7\X92foo
echo (printf '\ufdd8foo') | string escape
# CHECK: \Xef\Xb7\X98foo
printf '%s\n' "#!/bin/sh" 'echo $0' > $tmpdir/argv0.sh
chmod +x $tmpdir/argv0.sh
cd $tmpdir

View File

@@ -350,3 +350,17 @@ echo {asdf,~}
# CHECK: asdf /{{.*}}
echo {~}
# CHECK: {~}
function compare
test $argv[1] = $argv[2]
or begin
echo unexpected expansion result:
echo expected: $argv[1]
echo actual: $argv[2]
end
end
if string match -rq -- '^[\w.-]+$' $USER
set -l user_home "$(eval "echo ~$USER")"
compare $user_home "$(echo ~$USER)"
compare $user_home "$(echo ~(printf %s $USER))"
end