don't ignore left-curly-braces when searching for the end of a variable/function...
[asterisk/asterisk.git] / pbx.c
diff --git a/pbx.c b/pbx.c
index b66effc..85d692d 100644 (file)
--- 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] == '['))