aboutsummaryrefslogtreecommitdiffstats
path: root/main/cli.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2010-08-10 16:21:58 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2010-08-10 16:21:58 +0000
commit8aac32721870fe28f96e38b56e612105382d9619 (patch)
treeecba7a29554edb19cb6a5fcf462c1a2c0e7af94f /main/cli.c
parent815b5b09da5e555add7bba3d8fca588e7611248a (diff)
parent1fc76768a99f651fccb359a836928fec4a6615a4 (diff)
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: http://svn.digium.com/svn/asterisk/branches/1.8@281529 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/cli.c')
-rw-r--r--main/cli.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/main/cli.c b/main/cli.c
index c9dbc6d02..ebb7deb6d 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;
}