[Asterisk-code-review] res clialiases: Fix completion pass-through. (asterisk[13])
Jenkins2
asteriskteam at digium.com
Fri Dec 15 11:24:17 CST 2017
Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/7589 )
Change subject: res_clialiases: Fix completion pass-through.
......................................................................
res_clialiases: Fix completion pass-through.
Never ignore contents of line when generating completion options.
Change-Id: I74389efdfea154019d3b56a9f381610614c044c8
---
M res/res_clialiases.c
1 file changed, 2 insertions(+), 6 deletions(-)
Approvals:
Joshua Colp: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Jenkins2: Approved for Submit
diff --git a/res/res_clialiases.c b/res/res_clialiases.c
index 633ed89..4d932ae 100644
--- a/res/res_clialiases.c
+++ b/res/res_clialiases.c
@@ -105,7 +105,7 @@
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 @@
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;
--
To view, visit https://gerrit.asterisk.org/7589
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: I74389efdfea154019d3b56a9f381610614c044c8
Gerrit-Change-Number: 7589
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171215/e3b30739/attachment.html>
More information about the asterisk-code-review
mailing list