string shorten: Make max of 0 mean no shortening

This makes it easier to just slot in `string shorten` wherever,
without having to do a weird "if test $max -gt 0" check.
This commit is contained in:
Fabian Boehm
2022-10-04 18:44:21 +02:00
parent e4f07fe010
commit cb28b39b24
3 changed files with 22 additions and 1 deletions

View File

@@ -950,3 +950,8 @@ for i in (seq 1 (string length -V -- $str))
test $len = $i
or echo Oopsie ellipsizing to $i failed
end
string shorten -m0 foo bar asodjsaoidj
# CHECK: foo
# CHECK: bar
# CHECK: asodjsaoidj