提交 fdba0e07 authored 作者: Anthony Minessale's avatar Anthony Minessale

make parens optional on functions as vars ${foo(bar)} is now the same as ${foo bar}

上级 f13fa0c1
......@@ -2907,14 +2907,15 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables(switch_channel_t *channel
}
p = e > endof_indup ? endof_indup : e;
if ((vval = strchr(vname, '('))) {
if ((vval = strchr(vname, '(')) || (vval = strchr(vname, ' '))) {
if (*vval == '(') br = 1;
e = vval - 1;
*vval++ = '\0';
while (*e == ' ') {
*e-- = '\0';
}
e = vval;
br = 1;
while (e && *e) {
if (*e == '(') {
br++;
......
......@@ -1644,14 +1644,15 @@ SWITCH_DECLARE(char *) switch_event_expand_headers(switch_event_t *event, const
}
p = e > endof_indup ? endof_indup : e;
if ((vval = strchr(vname, '('))) {
if ((vval = strchr(vname, '(')) || (vval = strchr(vname, ' '))) {
if (*vval == '(') br = 1;
e = vval - 1;
*vval++ = '\0';
while (*e == ' ') {
*e-- = '\0';
}
e = vval;
br = 1;
while (e && *e) {
if (*e == '(') {
br++;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论