mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-14 17:07:44 +00:00
cc49042294
When a variable is parsed as being empty, parse out the slice and validate the indexes anyway, behaving for slicing purposes as if the variable had a single empty value. Besides providing errors when expected, this also fixes the following: set -l foo echo "$foo[1]" This used to print "[1]", now it properly prints nothing.
42 lines
404 B
Text
42 lines
404 B
Text
1
|
|
0
|
|
1 prefix
|
|
0
|
|
1
|
|
0
|
|
1 prefix
|
|
0
|
|
1
|
|
1
|
|
1 prefix
|
|
1 prefix
|
|
1
|
|
0
|
|
1 prefix
|
|
0
|
|
1
|
|
0
|
|
1 prefix
|
|
0
|
|
1 baz
|
|
1 baz
|
|
1 prefixbaz
|
|
1 prefixbaz
|
|
1 baz quux
|
|
2 baz quux
|
|
1 prefixbaz quux
|
|
2 prefixbaz prefixquux
|
|
1 baz quux fooer fooest
|
|
2 baz quux
|
|
1 prefixbaz quux fooer fooest
|
|
2 prefixbaz prefixquux
|
|
3 baz quux
|
|
3 prefixbaz prefixquux prefix
|
|
1 baz quux fooest
|
|
2 baz quux
|
|
1 prefixbaz quux fooest
|
|
2 prefixbaz prefixquux
|
|
1
|
|
0
|
|
1
|
|
0
|