aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-13 21:19:11 +0000
committermurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-13 21:19:11 +0000
commit136bb5795b67b6e80168c11ea27d5303a8a5d290 (patch)
tree3fe862c259199717a1e45f13e81c28b390e0a241
parentf43b8797fa33185621479aeb78ddeff3185b73ab (diff)
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
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89256 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--main/pbx.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/main/pbx.c b/main/pbx.c
index 6a59ff46d..71331b14a 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -1107,13 +1107,16 @@ struct match_char *add_exten_to_pattern_tree(struct ast_context *con, struct ast
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;