Index: ast_expr2.y =================================================================== RCS file: /usr/cvsroot/asterisk/ast_expr2.y,v retrieving revision 1.2 diff -u -r1.2 ast_expr2.y --- ast_expr2.y 20 May 2005 03:18:35 -0000 1.2 +++ ast_expr2.y 13 Jun 2005 15:39:26 -0000 @@ -296,10 +300,13 @@ /* vp->type == AST_EXPR_numeric_string, make it numeric */ errno = 0; - i = strtoq(vp->u.s, (char**)NULL, 10); + i = strtoll(vp->u.s, (char**)NULL, 10); if (errno != 0) { + char buffer10[10000]; + sprintf(buffer10, "Conversion of %s to integer under/overflowed!\n", vp->u.s); free(vp->u.s); - ast_log(LOG_WARNING,"overflow\n"); + vp->u.s = 0; + ast_log(LOG_WARNING,buffer10); return(0); } free (vp->u.s); @@ -433,8 +440,16 @@ to_string (b); r = make_integer ((quad_t)(strcoll (a->u.s, b->u.s) == 0)); } else { +#ifdef DEBUG_FOR_CONVERSIONS + char buffer[2000], buffer2[2000]; + sprintf(buffer,"Converting '%s' and '%s' ", a->u.s, b->u.s); +#endif (void)to_integer(a); (void)to_integer(b); +#ifdef DEBUG_FOR_CONVERSIONS + sprintf(buffer2,"%s to '%lld' and '%lld'\n", buffer, a->u.i, b->u.i); + ast_log(LOG_WARNING,buffer2); +#endif r = make_integer ((quad_t)(a->u.i == b->u.i)); } Index: ast_expr2.fl =================================================================== RCS file: /usr/cvsroot/asterisk/ast_expr2.fl,v retrieving revision 1.2 diff -u -r1.2 ast_expr2.fl --- ast_expr2.fl 20 May 2005 03:18:35 -0000 1.2 +++ ast_expr2.fl 13 Jun 2005 15:39:26 -0000 @@ -32,6 +32,7 @@ #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,12 +77,10 @@ \"[^"]*\" {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;} %%