[asterisk-commits] file: trunk r192700 - /trunk/res/res_clialiases.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed May 6 09:36:12 CDT 2009
Author: file
Date: Wed May 6 09:35:47 2009
New Revision: 192700
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=192700
Log:
Fix an infinite loop with tab completion of CLI aliases that reference themselves.
(closes issue #15020)
Reported by: junky
Modified:
trunk/res/res_clialiases.c
Modified: trunk/res/res_clialiases.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/res/res_clialiases.c?view=diff&rev=192700&r1=192699&r2=192700
==============================================================================
--- trunk/res/res_clialiases.c (original)
+++ trunk/res/res_clialiases.c Wed May 6 09:35:47 2009
@@ -98,7 +98,9 @@
case CLI_GENERATE:
line = a->line;
line += (strlen(alias->alias));
- if (!ast_strlen_zero(a->word)) {
+ if (!strncmp(alias->alias, alias->real_cmd, strlen(alias->alias))) {
+ generator = NULL;
+ } else if (!ast_strlen_zero(a->word)) {
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);
More information about the asterisk-commits
mailing list