summaryrefslogtreecommitdiff
path: root/pbx.c
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2006-04-18 23:24:02 +0000
committerKevin P. Fleming <kpfleming@digium.com>2006-04-18 23:24:02 +0000
commitc87f4bd7a8536487fe366f7ee86758d8786d2ab0 (patch)
tree2ae284c3cf056bb0681dcda7b1febb44085f35bd /pbx.c
parentd85073dc1f6c25d09610b8c56871474eaeae55d4 (diff)
don't ignore left-curly-braces when searching for the end of a variable/function reference; match them up with right-curly-braces so we choose the proper brace to end the reference (will still fail to parse properly if the reference contains unbalanced braces)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21235 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'pbx.c')
-rw-r--r--pbx.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pbx.c b/pbx.c
index b66effc35..85d692da9 100644
--- a/pbx.c
+++ b/pbx.c
@@ -1343,10 +1343,12 @@ static void pbx_substitute_variables_helper_full(struct ast_channel *c, struct v
needsub = 0;
/* Find the end of it */
- while(brackets && *vare) {
+ while (brackets && *vare) {
if ((vare[0] == '$') && (vare[1] == '{')) {
needsub++;
brackets++;
+ } else if (vare[0] == '{') {
+ brackets++;
} else if (vare[0] == '}') {
brackets--;
} else if ((vare[0] == '$') && (vare[1] == '['))