aboutsummaryrefslogtreecommitdiffstats
path: root/main/ast_expr2.y
diff options
context:
space:
mode:
authormurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2009-01-15 21:14:31 +0000
committermurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2009-01-15 21:14:31 +0000
commita92e8ebf8cf61b49417bf0ea1ebe2669e2194edb (patch)
tree19dccea4b0c8318c07f4cc45a48fbebab6f96bae /main/ast_expr2.y
parent0261e352aec9991d47c3ad6ebfb66e8993d7173d (diff)
Merged revisions 168737 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r168737 | murf | 2009-01-15 13:54:59 -0700 (Thu, 15 Jan 2009) | 16 lines 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: http://svn.digium.com/svn/asterisk/branches/1.6.0@168738 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/ast_expr2.y')
-rw-r--r--main/ast_expr2.y10
1 files changed, 8 insertions, 2 deletions
diff --git a/main/ast_expr2.y b/main/ast_expr2.y
index de7360020..30bdda034 100644
--- a/main/ast_expr2.y
+++ b/main/ast_expr2.y
@@ -387,12 +387,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:
@@ -699,7 +705,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) {