diff options
author | Joshua Colp <jcolp@digium.com> | 2017-12-15 11:29:20 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-12-15 11:29:20 -0600 |
commit | 7d3d75b6dc1f0ee1c15571fabeef0b0e59594906 (patch) | |
tree | cc5751aaf1fe635d64e80f4a81c029b23ed63770 | |
parent | b258f56ba33d074307fec634fe340a5c9dbbb046 (diff) | |
parent | e41bed371359ef5615f51f0b3d36e434d9401da5 (diff) |
Merge "res_clialiases: Fix completion pass-through." into 15
-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 1a2fc6939..337c31c97 100644 --- a/res/res_clialiases.c +++ b/res/res_clialiases.c @@ -103,7 +103,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 */ @@ -118,14 +118,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; |