summaryrefslogtreecommitdiff
path: root/pbx.c
diff options
context:
space:
mode:
Diffstat (limited to 'pbx.c')
-rwxr-xr-xpbx.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/pbx.c b/pbx.c
index 7387d7c95..fc7fe10ad 100755
--- a/pbx.c
+++ b/pbx.c
@@ -1099,10 +1099,15 @@ void pbx_substitute_variables_helper(struct ast_channel *c,const char *cp1,char
if ((vare[0] == '$') && (vare[1] == '[')) {
needsub++;
brackets++;
+ vare++;
+ } else if (vare[0] == '[') {
+ brackets++;
} else if (vare[0] == ']') {
brackets--;
- } else if ((vare[0] == '$') && (vare[1] == '{'))
+ } else if ((vare[0] == '$') && (vare[1] == '{')) {
needsub++;
+ vare++
+ }
vare++;
}
if (brackets)