[asterisk-commits] murf: trunk r89256 - /trunk/main/pbx.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Nov 13 15:19:11 CST 2007


Author: murf
Date: Tue Nov 13 15:19:11 2007
New Revision: 89256

URL: http://svn.digium.com/view/asterisk?view=rev&rev=89256
Log:
closes issue #11233 -- where some fine points in the algorithm to build the tree needed to be corrected. Many thanks for the test case, jtodd

Modified:
    trunk/main/pbx.c

Modified: trunk/main/pbx.c
URL: http://svn.digium.com/view/asterisk/trunk/main/pbx.c?view=diff&rev=89256&r1=89255&r2=89256
==============================================================================
--- trunk/main/pbx.c (original)
+++ trunk/main/pbx.c Tue Nov 13 15:19:11 2007
@@ -1107,13 +1107,16 @@
 			specif = 1;
 		}
 		
-		if (already && (m2=already_in_tree(m1,buf))) {
+		if (already && (m2=already_in_tree(m1,buf)) && m2->next_char) {
 			if (!(*(s1+1)))  /* if this is the end of the pattern, but not the end of the tree, then mark this node with the exten...
 								a shorter pattern might win if the longer one doesn't match */
-				m1->exten = e1;
+				m2->exten = e1;
 			m1 = m2->next_char; /* m1 points to the node to compare against */
 		} else {
-			m1 = add_pattern_node(con, m1, buf, pattern, already,specif); /* m1 is the node just added */
+			if (m2) {
+				m1 = m2;
+			} else 
+				m1 = add_pattern_node(con, m1, buf, pattern, already,specif); /* m1 is the node just added */
 			if (!(*(s1+1)))
 				m1->exten = e1;
 			already = 0;




More information about the asterisk-commits mailing list