fish-shell/fish-rust
Henrik Hørlück Berg 6dd2cd2b20 Fix behaviour in the presence of non-visible width
Padding with an unprintable character is now disallowed, like it was for other
zero-length characters.

`string shorten` now ignores escape sequences and non-printable characters
when calculating the visible width of the ellipsis used (except for `\b`,
which is treated as a width of -1).
Previously `fish_wcswidth` returned a length of -1 when the ellipsis-str
contained any non-printable character, causing the command to poentially
print a larger width than expected.

This also fixes an integer overflows in `string shorten`'s
`max` and `max2`, when the cumulative sum of character widths turned negative
(e.g. with any non-printable characters, or `\b` after the changes above).
The overflow potentially caused strings containing non-printable characters
to be truncated.

This adds test that verify the fixed behaviour.
2023-07-27 22:00:03 -07:00
..
src Fix behaviour in the presence of non-visible width 2023-07-27 22:00:03 -07:00
widestring-suffix Update dependencies for asan to work 2023-06-29 20:02:43 -05:00
build.rs Adopt the new function store and rewrite builtin_function 2023-07-23 17:18:36 -07:00
Cargo.lock Use a faster, deterministic RNG in the string escape tests 2023-07-04 13:27:53 -07:00
Cargo.toml Use a faster, deterministic RNG in the string escape tests 2023-07-04 13:27:53 -07:00