From c87f4bd7a8536487fe366f7ee86758d8786d2ab0 Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Tue, 18 Apr 2006 23:24:02 +0000 Subject: [PATCH] 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 --- pbx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pbx.c b/pbx.c index b66effc359..85d692da92 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] == '['))