mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-10 23:24:39 +00:00
set now expands the variable size, if index is outside it
This commit is contained in:
parent
9b0ffa8315
commit
22a4cd686f
1 changed files with 5 additions and 1 deletions
|
@ -260,10 +260,14 @@ static int update_values( wcstring_list_t &list,
|
|||
*/
|
||||
long ind = indexes[i] - 1;
|
||||
const wcstring newv = values[ i ];
|
||||
if( ind < 0 || ind>=list.size() )
|
||||
if( ind < 0 )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
if ( ind >= list.size() )
|
||||
{
|
||||
list.resize( ind+1 );
|
||||
}
|
||||
|
||||
// free((void *) al_get(list, ind));
|
||||
list[ ind ] = newv;
|
||||
|
|
Loading…
Reference in a new issue