fix nested brackets

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6172 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2007-11-07 02:14:57 +00:00
parent 3c470c8943
commit 14396001d2
2 changed files with 13 additions and 4 deletions

View File

@@ -1355,6 +1355,15 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables(switch_channel_t *channel
*e++ = '\0';
break;
}
if (br > 0) {
if (e != s && *e == '{') {
br++;
} else if (br > 1 && *e == '}') {
br--;
}
}
e++;
}
p = e;
@@ -1380,7 +1389,7 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables(switch_channel_t *channel
if (stream.data) {
char *expanded = NULL;
if ((expanded = switch_channel_expand_variables(channel, vval)) == vval) {
expanded = NULL;
} else {