From 3d5c00e1043aab3c2f18a9cf658bd316bdfb7020 Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Thu, 16 Dec 2004 14:33:56 +0000 Subject: [PATCH] Let negative number be parsed correctly. Needed for accessing actions with sequences such as -1. --- dlls/msi/sql.y | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/dlls/msi/sql.y b/dlls/msi/sql.y index cb06805f049..592e6bc2d61 100644 --- a/dlls/msi/sql.y +++ b/dlls/msi/sql.y @@ -62,9 +62,9 @@ static BOOL SQL_MarkPrimaryKeys( create_col_info *cols, static struct expr * EXPR_complex( struct expr *l, UINT op, struct expr *r ); static struct expr * EXPR_column( LPWSTR ); -static struct expr * EXPR_ival( struct sql_str *); +static struct expr * EXPR_ival( struct sql_str *, int sign); static struct expr * EXPR_sval( struct sql_str *); -static struct expr * EXPR_wildcard(void); +static struct expr * EXPR_wildcard(); %} @@ -543,7 +543,11 @@ column_assignment: const_val: TK_INTEGER { - $$ = EXPR_ival( &$1 ); + $$ = EXPR_ival( &$1, 1 ); + } + | TK_MINUS TK_INTEGER + { + $$ = EXPR_ival( &$2, -1 ); } | TK_STRING { @@ -717,13 +721,13 @@ static struct expr * EXPR_column( LPWSTR str ) return e; } -static struct expr * EXPR_ival( struct sql_str *str ) +static struct expr * EXPR_ival( struct sql_str *str , int sign) { struct expr *e = HeapAlloc( GetProcessHeap(), 0, sizeof *e ); if( e ) { e->type = EXPR_IVAL; - e->u.ival = atoiW( str->data ); + e->u.ival = atoiW( str->data ) * sign; } return e; }