From: Russell Bryant Date: Tue, 10 Aug 2010 16:21:58 +0000 (+0000) Subject: Resolve a problem with channel name tab completion. X-Git-Tag: 1.8.0-beta3~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=960fb7fd3a8006a2155cb0a05730288e994181c9;p=thirdparty%2Fasterisk.git Resolve a problem with channel name tab completion. Hitting tab without typing any part of a channel name resulted in no results. This now results in getting a full list of active channels, just as it did in previous versions of Asterisk. Review: https://reviewboard.asterisk.org/r/818/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@281529 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/cli.c b/main/cli.c index c9dbc6d02e..ebb7deb6d4 100644 --- a/main/cli.c +++ b/main/cli.c @@ -1485,7 +1485,13 @@ char *ast_complete_channels(const char *line, const char *word, int pos, int sta return NULL; } - if (!(iter = ast_channel_iterator_by_name_new(word, strlen(word)))) { + if (ast_strlen_zero(word)) { + iter = ast_channel_iterator_all_new(); + } else { + iter = ast_channel_iterator_by_name_new(word, strlen(word)); + } + + if (!iter) { return NULL; }