summaryrefslogtreecommitdiff
path: root/res/res_clialiases.c
diff options
context:
space:
mode:
Diffstat (limited to 'res/res_clialiases.c')
-rw-r--r--res/res_clialiases.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/res/res_clialiases.c b/res/res_clialiases.c
index 633ed89f4..355d437ab 100644
--- a/res/res_clialiases.c
+++ b/res/res_clialiases.c
@@ -21,7 +21,7 @@
* \brief CLI Aliases
*
* \author\verbatim Joshua Colp <jcolp@digium.com> \endverbatim
- *
+ *
* This module provides the capability to create aliases to other
* CLI commands.
*/
@@ -30,7 +30,7 @@
* \addtogroup configuration_file Configuration Files
*/
-/*!
+/*!
* \page cli_aliases.conf cli_aliases.conf
* \verbinclude cli_aliases.conf.sample
*/
@@ -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;
@@ -282,8 +278,8 @@ static int unload_module(void)
* Module loading including tests for configuration or dependencies.
* This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE,
* or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails
- * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the
- * configuration file or other non-critical problem return
+ * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the
+ * configuration file or other non-critical problem return
* AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS.
*/
static int load_module(void)