Updates from BitShares FC #22

Closed
nathanielhourt wants to merge 693 commits from dapp-support into latest-fc
Showing only changes of commit c225488cd4 - Show all commits

View file

@ -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;
} }
/*** /***