summaryrefslogtreecommitdiff
path: root/main/loader.c
diff options
context:
space:
mode:
authorCorey Farrell <git@cfware.com>2017-10-30 01:32:32 -0400
committerCorey Farrell <git@cfware.com>2017-10-30 00:40:12 -0500
commitcee81b3c8bb8b95ea3c1a9c29d556a3e6c9c7614 (patch)
tree16adc4a1233df9e3568ad8d78d6827e78f332520 /main/loader.c
parent2e5e7e0b143c2fdbd852d98a5d356a3fe1c3bc43 (diff)
Modules: Fix issues with CLI completion.
* Stop using ast_module_helper to check if a module is loaded, use ast_module_check instead (app_confbridge and app_meetme). * Stop ast_module_helper from listing reload classes when needsreload was not requested. ASTERISK-27378 Change-Id: Iaed8c1e4fcbeb242921dbac7929a0fe75ff4b239
Diffstat (limited to 'main/loader.c')
-rw-r--r--main/loader.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/main/loader.c b/main/loader.c
index 7b031b647..b07efc12b 100644
--- a/main/loader.c
+++ b/main/loader.c
@@ -716,8 +716,9 @@ char *ast_module_helper(const char *line, const char *word, int pos, int state,
int i, which=0, l = strlen(word);
char *ret = NULL;
- if (pos != rpos)
+ if (pos != rpos) {
return NULL;
+ }
AST_DLLIST_LOCK(&module_list);
AST_DLLIST_TRAVERSE(&module_list, cur, entry) {
@@ -730,10 +731,11 @@ char *ast_module_helper(const char *line, const char *word, int pos, int state,
}
AST_DLLIST_UNLOCK(&module_list);
- if (!ret) {
+ if (!ret && needsreload) {
for (i=0; !ret && reload_classes[i].name; i++) {
- if (!strncasecmp(word, reload_classes[i].name, l) && ++which > state)
+ if (!strncasecmp(word, reload_classes[i].name, l) && ++which > state) {
ret = ast_strdup(reload_classes[i].name);
+ }
}
}