mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
Fix occasional shoowing of the same completion twice. Than ks to Tassilo Horn for the bug report.
darcs-hash:20070317231623-ac50b-a9447aa60d0ca654713a5391a3f6137d29d98916.gz
This commit is contained in:
parent
3e1b0e587e
commit
1e524fbc7a
1 changed files with 8 additions and 4 deletions
8
reader.c
8
reader.c
|
@ -498,10 +498,14 @@ static void remove_duplicates( array_list_t *l )
|
|||
{
|
||||
int in, out;
|
||||
const wchar_t *prev;
|
||||
completion_t *first;
|
||||
|
||||
if( al_get_count( l ) == 0 )
|
||||
return;
|
||||
|
||||
prev = (wchar_t *)al_get( l, 0 );
|
||||
first = (completion_t *)al_get( l, 0 );
|
||||
prev = first->completion;
|
||||
|
||||
for( in=1, out=1; in < al_get_count( l ); in++ )
|
||||
{
|
||||
completion_t *curr = (completion_t *)al_get( l, in );
|
||||
|
@ -509,8 +513,8 @@ static void remove_duplicates( array_list_t *l )
|
|||
if( wcscmp( prev, curr->completion )!=0 )
|
||||
{
|
||||
al_set( l, out++, curr );
|
||||
prev = curr->completion;
|
||||
}
|
||||
prev = curr->completion;
|
||||
}
|
||||
al_truncate( l, out );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue