aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-04 04:28:48 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-04 04:28:48 +0000
commitd8799569cbf8fb52178cceda17d749ead65ac115 (patch)
tree1e88d28d52a7519f1c96b7003d73f7f0174fc876 /main
parente1a4a45eefe284cac2e62889ac1a282e9060086b (diff)
- Add curly braces around the while loop
- Properly break out of the loop on error when an included context is not found git-svn-id: http://svn.digium.com/svn/asterisk/trunk@105590 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/pbx.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/main/pbx.c b/main/pbx.c
index ff39a8c66..f638a4953 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -7758,12 +7758,16 @@ int ast_context_verify_includes(struct ast_context *con)
struct ast_include *inc = NULL;
int res = 0;
- while ( (inc = ast_walk_context_includes(con, inc)) )
- if (!ast_context_find(inc->rname)) {
- res = -1;
- ast_log(LOG_WARNING, "Context '%s' tries to include nonexistent context '%s'\n",
- ast_get_context_name(con), inc->rname);
- }
+ while ( (inc = ast_walk_context_includes(con, inc)) ) {
+ if (ast_context_find(inc->rname))
+ continue;
+
+ res = -1;
+ ast_log(LOG_WARNING, "Context '%s' tries to include nonexistent context '%s'\n",
+ ast_get_context_name(con), inc->rname);
+ break;
+ }
+
return res;
}