mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 20:16:12 +08:00
Correct misdetection of [001]
as literal zero index
The control flow in expand.cpp is a bit more complicated than it seemed at first blush. Ref #4862.
This commit is contained in:
parent
c02bf2548f
commit
0e62dedb26
|
@ -260,6 +260,7 @@ static size_t parse_slice(const wchar_t *in, wchar_t **end_ptr, std::vector<long
|
|||
}
|
||||
|
||||
// debug( 0, L"Push idx %d", tmp );
|
||||
literal_zero_index = literal_zero_index && tmp == 0;
|
||||
idx.push_back(i1);
|
||||
source_positions.push_back(i1_src_pos);
|
||||
}
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
echo $foo[0]
|
||||
echo $foo[ 0 ]
|
||||
echo $foo[ 00 ]
|
||||
|
||||
# and make sure these didn't break
|
||||
set -l foo one two three
|
||||
echo $foo[001]
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
one
|
Loading…
Reference in New Issue
Block a user