mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-15 23:22:53 +08:00
fix path --null-out
Regression from 7bc4c9674bb24f09e0b7af89442f700864217327. Appending `"\0"` to an std::string does nothing. I blame C++.
This commit is contained in:
parent
897d95a654
commit
dcf52dbba5
@ -201,7 +201,9 @@ static void path_out(io_streams_t &streams, const options_t &opts, const wcstrin
|
|||||||
if (!opts.null_out) {
|
if (!opts.null_out) {
|
||||||
streams.out.append_with_separation(str, separation_type_t::explicitly);
|
streams.out.append_with_separation(str, separation_type_t::explicitly);
|
||||||
} else {
|
} else {
|
||||||
streams.out.append(str + L"\0");
|
// Note the char - if this was a string instead we'd add
|
||||||
|
// a string of length 0, i.e. nothing
|
||||||
|
streams.out.append(str + L'\0');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -222,3 +222,11 @@ set -l epochtime (path mtime epoch)
|
|||||||
# Allow for timezone shenanigans
|
# Allow for timezone shenanigans
|
||||||
test $epochtime -gt 0 -a $epochtime -lt 180000
|
test $epochtime -gt 0 -a $epochtime -lt 180000
|
||||||
or echo Oops not mtime
|
or echo Oops not mtime
|
||||||
|
|
||||||
|
path basename -Z foo bar baz | path sort
|
||||||
|
# CHECK: bar
|
||||||
|
# CHECK: baz
|
||||||
|
# CHECK: foo
|
||||||
|
|
||||||
|
path basename --null-out bar baz | string escape
|
||||||
|
# CHECK: bar\x00baz\x00
|
||||||
|
Loading…
x
Reference in New Issue
Block a user