From: Russell Bryant Date: Tue, 4 Mar 2008 04:28:48 +0000 (+0000) Subject: - Add curly braces around the while loop X-Git-Tag: 1.6.0-beta7~239 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d3b25158825ffa09cc4eedf8e67f5d80642c063;p=thirdparty%2Fasterisk.git - 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: https://origsvn.digium.com/svn/asterisk/trunk@105590 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/pbx.c b/main/pbx.c index ff39a8c665..f638a4953e 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; }