mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
Fix off-by-one error making it impossible to edit the first element of an array using array slicing. Thanks to useer for reporting this bug.
darcs-hash:20061208133136-ac50b-3c8085ec61fcc3987356ee412133dba6c7f32d1f.gz
This commit is contained in:
parent
f83b754cd4
commit
b156f083be
1 changed files with 2 additions and 2 deletions
|
@ -274,11 +274,11 @@ static int update_values( array_list_t *list,
|
|||
{
|
||||
/*
|
||||
The '- 1' below is because the indices in fish are
|
||||
one-based, but the array_lsit_t uses zero-based indices
|
||||
one-based, but the array_list_t uses zero-based indices
|
||||
*/
|
||||
long ind = al_get_long(indexes, i) - 1;
|
||||
void *new = (void *) al_get(values, i);
|
||||
if( ind <= 0 )
|
||||
if( ind < 0 )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue