mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-25 12:23:09 +00:00
Correct read behavior for unset values and update tests accordingly
`read` with IFS empty was expected to set all parameters after the first n filled variables to an empty string, but that was inconsistent with the behavior of `read` everywhere else. I'm not sure why fish differed from the spec with regards to the behavior in the event of an empty IFS: we eschew IFS where possible, yet here we adopt non-standard behavior splitting on every (unicode) character instead of not splitting at all with IFS empty. We still do that, but now the unset variables are treated as they normally would be, i.e. cleared and not set to an empty string (which is what an empty value between two IFS separators would contain).
This commit is contained in:
parent
3742a7827f
commit
c2cfc65cf2
1 changed files with 3 additions and 3 deletions
|
@ -35,9 +35,9 @@ two
|
|||
1 'hello'
|
||||
1 'h' 1 'ello'
|
||||
1 'h' 1 'e' 1 'llo'
|
||||
1 ''
|
||||
1 't' 1 ''
|
||||
1 't' 1 '' 1 ''
|
||||
0
|
||||
1 't' 0
|
||||
1 't' 0 0
|
||||
1 ' ' 1 't'
|
||||
|
||||
2 'hello' 'there'
|
||||
|
|
Loading…
Reference in a new issue