diff options
author | Jenkins2 <jenkins2@gerrit.asterisk.org> | 2017-12-15 11:24:17 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-12-15 11:24:17 -0600 |
commit | 2ea359f738bca6c6c2c0690809fa0801e7c3b120 (patch) | |
tree | 0819097306f640eb385d2dfecf461835f97ab4f4 /res | |
parent | 1865b3d230b66e870776515a3e5f8f1164797e27 (diff) | |
parent | 85dec2ae4fa79abe95dc71aa75a3bce50e6c5c36 (diff) |
Merge "res_clialiases: Fix completion pass-through." into 13
Diffstat (limited to 'res')
-rw-r--r-- | res/res_clialiases.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/res/res_clialiases.c b/res/res_clialiases.c index 633ed89f4..4d932aecc 100644 --- a/res/res_clialiases.c +++ b/res/res_clialiases.c @@ -105,7 +105,7 @@ static char *cli_alias_passthrough(struct ast_cli_entry *e, int cmd, struct ast_ struct cli_alias tmp = { .cli_entry.command = e->command, }; - char *generator; + char *generator = NULL; const char *line; /* Try to find the alias based on the CLI entry */ @@ -120,14 +120,10 @@ static char *cli_alias_passthrough(struct ast_cli_entry *e, int cmd, struct ast_ case CLI_GENERATE: line = a->line; line += (strlen(alias->alias)); - if (!strncasecmp(alias->alias, alias->real_cmd, strlen(alias->alias))) { - generator = NULL; - } else if (!ast_strlen_zero(a->word)) { + if (strncasecmp(alias->alias, alias->real_cmd, strlen(alias->alias))) { struct ast_str *real_cmd = ast_str_alloca(strlen(alias->real_cmd) + strlen(line) + 1); ast_str_append(&real_cmd, 0, "%s%s", alias->real_cmd, line); generator = ast_cli_generator(ast_str_buffer(real_cmd), a->word, a->n); - } else { - generator = ast_cli_generator(alias->real_cmd, a->word, a->n); } ao2_ref(alias, -1); return generator; |