From: Kevin P. Fleming Date: Tue, 18 Apr 2006 23:24:02 +0000 (+0000) Subject: don't ignore left-curly-braces when searching for the end of a variable/function... X-Git-Tag: 1.4.0-beta1~1888 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c87f4bd7a8536487fe366f7ee86758d8786d2ab0;p=thirdparty%2Fasterisk.git 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 --- 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] == '['))