Sortiere die Liste der uns bei Tab-Vervollständigung vorgeschlagenen

CVAR
This commit is contained in:
Yamagi Burmeister 2010-10-28 07:30:42 +00:00
parent 66ac4643cb
commit 4ece83cd3c

View file

@ -315,6 +315,11 @@ Cmd_Exists ( char *cmd_name )
return ( false );
}
int qsort_strcomp ( const void *s1, const void *s2 )
{
return (strcmp(*(char **)s1, *(char **)s2));
}
char *
Cmd_CompleteCommand ( char *partial )
{
@ -399,6 +404,9 @@ Cmd_CompleteCommand ( char *partial )
return ( pmatch [ 0 ] );
}
/* Sort it */
qsort(pmatch, i, sizeof(pmatch[0]), qsort_strcomp);
Com_Printf( "\n\n", partial );
for ( o = 0; o < i; o++ )