diff --git a/pbx.c b/pbx.c index 9ef1c1936e..183a0acda0 100644 --- a/pbx.c +++ b/pbx.c @@ -1471,9 +1471,10 @@ 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++; + } else if (vare[0] == '{') { brackets++; } else if (vare[0] == '}') { brackets--;