diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-03-04 04:31:29 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-03-04 04:31:29 +0000 |
commit | f9191c4c9fbc8092532bafe28a2d3db267c550ab (patch) | |
tree | 98b969717686dd90db5d7c702ae05e28804e33b8 /main/pbx.c | |
parent | 2637c6cda0e6c7cf3f016f147be6f4a81e31760e (diff) |
Backport a minor bug fix from trunk that I found while doing random code
cleanup. Properly break out of the loop when a context isn't found when
verify that includes are valid.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@105591 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/pbx.c')
-rw-r--r-- | main/pbx.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/main/pbx.c b/main/pbx.c index 05e3b2d45..fe3252c0d 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -6305,12 +6305,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 includes 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 includes nonexistent context '%s'\n", + ast_get_context_name(con), inc->rname); + break; + } + return res; } |