mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 01:36:39 +08: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
12
reader.c
12
reader.c
|
@ -498,19 +498,23 @@ 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 );
|
||||
|
||||
|
||||
if( wcscmp( prev, curr->completion )!=0 )
|
||||
{
|
||||
al_set( l, out++, curr );
|
||||
prev = curr->completion;
|
||||
}
|
||||
prev = curr->completion;
|
||||
}
|
||||
al_truncate( l, out );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user