|
|
@ -1511,7 +1511,7 @@ static int ast_cli_display_match_list(char **matches, int len, int max)
|
|
|
|
|
|
|
|
|
|
|
|
idx = 1;
|
|
|
|
idx = 1;
|
|
|
|
|
|
|
|
|
|
|
|
qsort(&matches[0], (size_t)(len + 1), sizeof(char *), ast_el_sort_compare);
|
|
|
|
qsort(&matches[0], (size_t)(len), sizeof(char *), ast_el_sort_compare);
|
|
|
|
|
|
|
|
|
|
|
|
for (; count > 0; count--) {
|
|
|
|
for (; count > 0; count--) {
|
|
|
|
numoutputline = 0;
|
|
|
|
numoutputline = 0;
|
|
|
@ -1603,12 +1603,14 @@ static char *cli_complete(EditLine *el, int ch)
|
|
|
|
} else
|
|
|
|
} else
|
|
|
|
matches = (char **) NULL;
|
|
|
|
matches = (char **) NULL;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
char **p;
|
|
|
|
char **p, *oldbuf=NULL;
|
|
|
|
int count = 0;
|
|
|
|
nummatches = 0;
|
|
|
|
matches = ast_cli_completion_matches((char *)lf->buffer,ptr);
|
|
|
|
matches = ast_cli_completion_matches((char *)lf->buffer,ptr);
|
|
|
|
for (p = matches; p && *p; p++)
|
|
|
|
for (p = matches; p && *p; p++) {
|
|
|
|
count++;
|
|
|
|
if (!oldbuf || strcmp(*p,oldbuf))
|
|
|
|
nummatches = count - 1; /* XXX apparently there is one dup ? */
|
|
|
|
nummatches++;
|
|
|
|
|
|
|
|
oldbuf = *p;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (matches) {
|
|
|
|
if (matches) {
|
|
|
|