mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
This patch allows null args in ast_expr2 func calls, and fixes commas being converted to pipes, which was 1.4 type stuff.
If the user says count=ENUMLOOKUP(${EXTEN},ALL,c,,enum.mydomain.tld); then it won't complain about the empty arg (c,,...) and fabled's patch won't let it swap the commas for pipes. Ran it thru my dialplan and no complaints. (closes issue #14169) Reported by: fabled Patches: function-argument-separator-fix.diff uploaded by fabled (license 448) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@168737 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -386,12 +386,18 @@ start: expr { ((struct parse_io *)parseio)->val = (struct val *)calloc(sizeof(st
|
||||
;
|
||||
|
||||
arglist: expr { $$ = alloc_expr_node(AST_EXPR_NODE_VAL); $$->val = $1;}
|
||||
| arglist TOK_COMMA expr %prec TOK_RP{struct expr_node *x = alloc_expr_node(AST_EXPR_NODE_VAL);
|
||||
| arglist TOK_COMMA expr %prec TOK_RP {struct expr_node *x = alloc_expr_node(AST_EXPR_NODE_VAL);
|
||||
struct expr_node *t;
|
||||
DESTROY($2);
|
||||
for (t=$1;t->right;t=t->right)
|
||||
;
|
||||
$$ = $1; t->right = x; x->val = $3;}
|
||||
| arglist TOK_COMMA %prec TOK_RP {struct expr_node *x = alloc_expr_node(AST_EXPR_NODE_VAL);
|
||||
struct expr_node *t; /* NULL args should OK */
|
||||
DESTROY($2);
|
||||
for (t=$1;t->right;t=t->right)
|
||||
;
|
||||
$$ = $1; t->right = x; x->val = make_str("");}
|
||||
;
|
||||
|
||||
expr:
|
||||
@@ -702,7 +708,7 @@ static char *compose_func_args(struct expr_node *arglist)
|
||||
char numbuf[30];
|
||||
|
||||
if (t != arglist)
|
||||
strcat(argbuf,"|");
|
||||
strcat(argbuf,",");
|
||||
|
||||
if (t->val) {
|
||||
if (t->val->type == AST_EXPR_number) {
|
||||
|
Reference in New Issue
Block a user