]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Backport a minor bug fix from trunk that I found while doing random code
authorRussell Bryant <russell@russellbryant.com>
Tue, 4 Mar 2008 04:31:29 +0000 (04:31 +0000)
committerRussell Bryant <russell@russellbryant.com>
Tue, 4 Mar 2008 04:31:29 +0000 (04:31 +0000)
cleanup.  Properly break out of the loop when a context isn't found when
verify that includes are valid.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@105591 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/pbx.c

index 05e3b2d451ff3ce193bf0f6feb44af1a8ed7a257..fe3252c0d3a4f86497bdfb80956a2ffb1d7e5027 100644 (file)
@@ -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;
 }