Cleanup handling of complex expressions (bug #1919)
authorMark Spencer <markster@digium.com>
Fri, 25 Jun 2004 18:23:26 +0000 (18:23 +0000)
committerMark Spencer <markster@digium.com>
Fri, 25 Jun 2004 18:23:26 +0000 (18:23 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3304 65c4cc65-6c06-0410-ace0-fbb531ad65f3

pbx.c

diff --git a/pbx.c b/pbx.c
index 7387d7c..fc7fe10 100755 (executable)
--- 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)