Updates from BitShares FC #22
1 changed files with 13 additions and 13 deletions
|
|
@ -153,22 +153,22 @@ static char *my_rl_complete(char *token, int *match)
|
||||||
*/
|
*/
|
||||||
static int cli_completion(char *token, char ***av)
|
static int cli_completion(char *token, char ***av)
|
||||||
{
|
{
|
||||||
int num, total = 0;
|
int num, total = 0;
|
||||||
char **copy;
|
char **copy;
|
||||||
|
|
||||||
auto& cmd = cli_commands();
|
auto& cmd = cli_commands();
|
||||||
num = cmd.size();
|
num = cmd.size();
|
||||||
|
|
||||||
copy = (char **) malloc (num * sizeof(char *));
|
copy = (char **) malloc (num * sizeof(char *));
|
||||||
for (auto it : cmd) {
|
for (auto it : cmd) {
|
||||||
if (!strncmp (it.c_str(), token, strlen (token))) {
|
if (!strncmp (it.c_str(), token, strlen (token))) {
|
||||||
copy[total] = strdup ( it.c_str() );
|
copy[total] = strdup ( it.c_str() );
|
||||||
total ++;
|
total ++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*av = copy;
|
*av = copy;
|
||||||
|
|
||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***
|
/***
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue