Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
b15c264d
Commit
b15c264d
authored
May 31, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
May 31, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve number parsing and avoid unicode.h.
parent
883413fa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
14 deletions
+31
-14
sql.y
dlls/msi/sql.y
+31
-14
No files found.
dlls/msi/sql.y
View file @
b15c264d
...
...
@@ -32,7 +32,6 @@
#include "query.h"
#include "wine/list.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#define YYLEX_PARAM info
#define YYPARSE_PARAM info
...
...
@@ -61,7 +60,7 @@ static BOOL SQL_MarkPrimaryKeys( column_info *cols, column_info *keys);
static struct expr * EXPR_complex( void *info, struct expr *l, UINT op, struct expr *r );
static struct expr * EXPR_column( void *info, column_info *column );
static struct expr * EXPR_ival( void *info,
struct sql_str *, int sign
);
static struct expr * EXPR_ival( void *info,
int val
);
static struct expr * EXPR_sval( void *info, struct sql_str * );
static struct expr * EXPR_wildcard( void *info );
...
...
@@ -77,6 +76,7 @@ static struct expr * EXPR_wildcard( void *info );
MSIVIEW *query;
struct expr *expr;
USHORT column_type;
int integer;
}
%token TK_ABORT TK_AFTER TK_AGG_FUNCTION TK_ALL TK_AND TK_AS TK_ASC
...
...
@@ -130,6 +130,7 @@ static struct expr * EXPR_wildcard( void *info );
%type <query> oneupdate onedelete oneselect onequery onecreate oneinsert
%type <expr> expr val column_val const_val
%type <column_type> column_type data_type data_type_l data_count
%type <integer> number
%%
...
...
@@ -316,13 +317,11 @@ data_type:
;
data_count:
TK_INTEGER
number
{
SQL_input* sql = (SQL_input*) info;
int val = SQL_getint(sql);
if( ( val > 255 ) || ( val < 0 ) )
if( ( $1 > 255 ) || ( $1 < 0 ) )
YYABORT;
$$ =
val
;
$$ =
$1
;
}
;
...
...
@@ -529,15 +528,15 @@ column_assignment:
;
const_val:
TK_INTEGER
number
{
$$ = EXPR_ival( info,
&$1,
1 );
$$ = EXPR_ival( info,
$
1 );
if( !$$ )
YYABORT;
}
| TK_MINUS
TK_INTEGER
| TK_MINUS
number
{
$$ = EXPR_ival( info,
&$2, -1
);
$$ = EXPR_ival( info,
-$2
);
if( !$$ )
YYABORT;
}
...
...
@@ -595,6 +594,13 @@ id:
}
;
number:
TK_INTEGER
{
$$ = SQL_getint( info );
}
;
%%
static void *parser_alloc( void *info, unsigned int sz )
...
...
@@ -675,8 +681,19 @@ INT SQL_getint( void *info )
{
SQL_input* sql = (SQL_input*) info;
LPCWSTR p = &sql->command[sql->n];
INT i, r = 0;
for( i=0; i<sql->len; i++ )
{
if( '0' > p[i] || '9' < p[i] )
{
ERR("should only be numbers here!\n");
break;
}
r = (p[i]-'0') + r*10;
}
return
atoiW( p )
;
return
r
;
}
int SQL_error( const char *str )
...
...
@@ -718,13 +735,13 @@ static struct expr * EXPR_column( void *info, column_info *column )
return e;
}
static struct expr * EXPR_ival( void *info,
struct sql_str *str, int sign
)
static struct expr * EXPR_ival( void *info,
int val
)
{
struct expr *e = parser_alloc( info, sizeof *e );
if( e )
{
e->type = EXPR_IVAL;
e->u.ival =
atoiW( str->data ) * sign
;
e->u.ival =
val
;
}
return e;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment