mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-25 08:48:31 -05:00
edit: Sort completion list
This commit is contained in:
parent
79a670cbf7
commit
ef6ee3e5a3
@ -349,6 +349,11 @@ static int max_common_length(char **c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int cmp_str(const void *a, const void *b)
|
||||||
|
{
|
||||||
|
return os_strcmp(* (const char **) a, * (const char **) b);
|
||||||
|
}
|
||||||
|
|
||||||
static void complete(int list)
|
static void complete(int list)
|
||||||
{
|
{
|
||||||
char **c;
|
char **c;
|
||||||
@ -379,6 +384,7 @@ static void complete(int list)
|
|||||||
len = max_common_length(c);
|
len = max_common_length(c);
|
||||||
if (len <= plen && count > 1) {
|
if (len <= plen && count > 1) {
|
||||||
if (list) {
|
if (list) {
|
||||||
|
qsort(c, count, sizeof(char *), cmp_str);
|
||||||
edit_clear_line();
|
edit_clear_line();
|
||||||
printf("\r");
|
printf("\r");
|
||||||
for (i = 0; c[i]; i++)
|
for (i = 0; c[i]; i++)
|
||||||
|
Loading…
Reference in New Issue
Block a user