are instead of having the list of matches generated twice (issue #6066)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7655
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
free(mbuf);
} else
matches = (char **) NULL;
-
-
} else {
-
- nummatches = ast_cli_generatornummatches((char *)lf->buffer,ptr);
+ char **p;
+ int count = 0;
matches = ast_cli_completion_matches((char *)lf->buffer,ptr);
+ for (p = matches; p && *p; p++)
+ count++;
+ nummatches = count - 1; /* XXX apparently there is one dup ? */
}
if (matches) {
retval = CC_REFRESH;
}
}
- free(matches);
+ free(matches);
}
return (char *)(long)retval;