summaryrefslogtreecommitdiff
path: root/pbx/pbx_config.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2017-12-20 08:34:37 -0600
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-12-20 08:34:37 -0600
commit616659d62012a1dc5eb69376f35d2c89fceaf6ea (patch)
tree891fd4e1f991c01079b5baa05eba39018d919dc6 /pbx/pbx_config.c
parentb1002338018a37043096d0b6bbe2854bc36d68cc (diff)
parent9adffca9c786c3b62eefd9de519287b9801f9fec (diff)
Merge "CLI: Address multiple issues." into 13
Diffstat (limited to 'pbx/pbx_config.c')
-rw-r--r--pbx/pbx_config.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c
index c4a0e6c28..1a1c73c64 100644
--- a/pbx/pbx_config.c
+++ b/pbx/pbx_config.c
@@ -303,8 +303,10 @@ static char *complete_dialplan_remove_include(struct ast_cli_args *a)
while ( (nc = ast_walk_contexts(nc)) && nc != c && !already_served)
already_served = lookup_ci(nc, i_name);
- if (!already_served && ++which > a->n)
+ if (!already_served && ++which > a->n) {
res = strdup(i_name);
+ break;
+ }
}
ast_unlock_context(c);
}
@@ -1523,17 +1525,21 @@ static char *complete_dialplan_remove_ignorepat(struct ast_cli_args *a)
}
for (c = NULL; !ret && (c = ast_walk_contexts(c)); ) {
- if (ast_rdlock_context(c)) /* fail, skip it */
+ if (ast_rdlock_context(c)) {
+ /* fail, skip it */
continue;
- if (!partial_match(ast_get_context_name(c), a->word, len))
+ }
+ if (!partial_match(ast_get_context_name(c), a->word, len)) {
+ ast_unlock_context(c);
continue;
+ }
if (lookup_c_ip(c, ignorepat) && ++which > a->n)
ret = strdup(ast_get_context_name(c));
ast_unlock_context(c);
}
ast_unlock_contexts();
free(dupline);
- return NULL;
+ return ret;
}
return NULL;