[asterisk-commits] russell: trunk r105590 - /trunk/main/pbx.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Mar 3 22:28:49 CST 2008


Author: russell
Date: Mon Mar  3 22:28:48 2008
New Revision: 105590

URL: http://svn.digium.com/view/asterisk?view=rev&rev=105590
Log:
 - Add curly braces around the while loop
 - Properly break out of the loop on error when an included context is not found

Modified:
    trunk/main/pbx.c

Modified: trunk/main/pbx.c
URL: http://svn.digium.com/view/asterisk/trunk/main/pbx.c?view=diff&rev=105590&r1=105589&r2=105590
==============================================================================
--- trunk/main/pbx.c (original)
+++ trunk/main/pbx.c Mon Mar  3 22:28:48 2008
@@ -7758,12 +7758,16 @@
 	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;
 }
 




More information about the asterisk-commits mailing list