[svn-commits] trunk r25856 - /trunk/pbx.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Mon May 8 23:04:46 MST 2006


Author: rizzo
Date: Tue May  9 01:04:45 2006
New Revision: 25856

URL: http://svn.digium.com/view/asterisk?rev=25856&view=rev
Log:
more small simplifications


Modified:
    trunk/pbx.c

Modified: trunk/pbx.c
URL: http://svn.digium.com/view/asterisk/trunk/pbx.c?rev=25856&r1=25855&r2=25856&view=diff
==============================================================================
--- trunk/pbx.c (original)
+++ trunk/pbx.c Tue May  9 01:04:45 2006
@@ -4183,15 +4183,16 @@
 	tmp->registrar = registrar;
 	
 	ast_mutex_lock(&con->lock);
-	for (e = con->root; e; e = e->next) {
-		/* Make sure patterns are always last! */
-		if ((e->exten[0] != '_') && (extension[0] == '_'))
+	for (e = con->root; e; el = e, e = e->next) {   /* scan the extension list */
+		/* XXX should use ext_cmp() to sort patterns correctly */
+		/* almost strcmp, but make sure patterns are always last! */
+		if (e->exten[0] != '_' && extension[0] == '_')
 			res = -1;
-		else if ((e->exten[0] == '_') && (extension[0] != '_'))
+		else if (e->exten[0] == '_' && extension[0] != '_')
 			res = 1;
 		else
 			res= strcmp(e->exten, extension);
-		if (!res) {
+		if (res == 0) { /* extension match, now look at cidmatch */
 			if (!e->matchcid && !tmp->matchcid)
 				res = 0;
 			else if (tmp->matchcid && !e->matchcid)



More information about the svn-commits mailing list