diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-06-17 00:33:00 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-06-17 00:33:00 +0000 |
commit | 8698db8b5da2eca74fb04b02e86a742fab4d500f (patch) | |
tree | d9fc14eb7b148abc23b71e1984a566e24cd9bc7e /ast_expr2.fl | |
parent | 20cc8387a96393f0583cae71150c6fb3146a0f9c (diff) |
Fix expression handling for string comparisions without quotes (bug #4478)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5919 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'ast_expr2.fl')
-rwxr-xr-x | ast_expr2.fl | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ast_expr2.fl b/ast_expr2.fl index 452d28f3c..55dffd5d8 100755 --- a/ast_expr2.fl +++ b/ast_expr2.fl @@ -32,6 +32,7 @@ struct val { #define SET_COLUMNS yylloc_param->first_column = (int)(yyg->yytext_r - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf);yylloc_param->last_column = yylloc_param->last_column + yyleng - 1; yylloc_param->first_line = yylloc_param->last_line = 1 #define SET_STRING yylval_param->val = (struct val *)calloc(sizeof(struct val),1); yylval_param->val->type = AST_EXPR_string; yylval_param->val->u.s = strdup(yytext); +#define SET_NUMERIC_STRING yylval_param->val = (struct val *)calloc(sizeof(struct val),1); yylval_param->val->type = AST_EXPR_numeric_string; yylval_param->val->u.s = strdup(yytext); struct parse_io { @@ -74,10 +75,8 @@ struct parse_io \"[^"]*\" {SET_COLUMNS; SET_STRING; return TOKEN;} [\n] {/* what to do with eol */} -[0-9]+ { SET_COLUMNS; - yylval_param->val = (struct val *)calloc(sizeof(struct val),1); - yylval_param->val->type = AST_EXPR_integer; - yylval_param->val->u.i = atoi(yytext); +[0-9]+ { SET_COLUMNS; /* the original behavior of the expression parser was to bring in numbers as a numeric string */ + SET_NUMERIC_STRING; return TOKEN;} [a-zA-Z0-9,.?';{}\\_^%$#@!]+ {SET_COLUMNS; SET_STRING; return TOKEN;} |