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
a35adb19
Commit
a35adb19
authored
Nov 08, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Treat only ASCII digits as digits.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f34cecba
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
9 deletions
+14
-9
lex.c
dlls/vbscript/lex.c
+7
-7
vbregexp.c
dlls/vbscript/vbregexp.c
+2
-2
vbscript.h
dlls/vbscript/vbscript.h
+5
-0
No files found.
dlls/vbscript/lex.c
View file @
a35adb19
...
...
@@ -214,7 +214,7 @@ static int parse_numeric_literal(parser_ctx_t *ctx, void **ret)
if
(
*
ctx
->
ptr
==
'0'
&&
!
(
'0'
<=
ctx
->
ptr
[
1
]
&&
ctx
->
ptr
[
1
]
<=
'9'
)
&&
ctx
->
ptr
[
1
]
!=
'.'
)
return
*
ctx
->
ptr
++
;
while
(
ctx
->
ptr
<
ctx
->
end
&&
is
w
digit
(
*
ctx
->
ptr
))
{
while
(
ctx
->
ptr
<
ctx
->
end
&&
is
_
digit
(
*
ctx
->
ptr
))
{
hlp
=
d
*
10
+
*
(
ctx
->
ptr
++
)
-
'0'
;
if
(
d
>
MAXLONGLONG
/
10
||
hlp
<
0
)
{
exp
++
;
...
...
@@ -223,7 +223,7 @@ static int parse_numeric_literal(parser_ctx_t *ctx, void **ret)
else
d
=
hlp
;
}
while
(
ctx
->
ptr
<
ctx
->
end
&&
is
w
digit
(
*
ctx
->
ptr
))
{
while
(
ctx
->
ptr
<
ctx
->
end
&&
is
_
digit
(
*
ctx
->
ptr
))
{
exp
++
;
ctx
->
ptr
++
;
}
...
...
@@ -232,7 +232,7 @@ static int parse_numeric_literal(parser_ctx_t *ctx, void **ret)
use_int
=
FALSE
;
ctx
->
ptr
++
;
while
(
ctx
->
ptr
<
ctx
->
end
&&
is
w
digit
(
*
ctx
->
ptr
))
{
while
(
ctx
->
ptr
<
ctx
->
end
&&
is
_
digit
(
*
ctx
->
ptr
))
{
hlp
=
d
*
10
+
*
(
ctx
->
ptr
++
)
-
'0'
;
if
(
d
>
MAXLONGLONG
/
10
||
hlp
<
0
)
break
;
...
...
@@ -240,7 +240,7 @@ static int parse_numeric_literal(parser_ctx_t *ctx, void **ret)
d
=
hlp
;
exp
--
;
}
while
(
ctx
->
ptr
<
ctx
->
end
&&
is
w
digit
(
*
ctx
->
ptr
))
while
(
ctx
->
ptr
<
ctx
->
end
&&
is
_
digit
(
*
ctx
->
ptr
))
ctx
->
ptr
++
;
}
...
...
@@ -255,7 +255,7 @@ static int parse_numeric_literal(parser_ctx_t *ctx, void **ret)
ctx
->
ptr
++
;
}
if
(
!
is
w
digit
(
*
ctx
->
ptr
))
{
if
(
!
is
_
digit
(
*
ctx
->
ptr
))
{
FIXME
(
"Invalid numeric literal
\n
"
);
return
0
;
}
...
...
@@ -266,7 +266,7 @@ static int parse_numeric_literal(parser_ctx_t *ctx, void **ret)
e
=
e
*
10
+
*
(
ctx
->
ptr
++
)
-
'0'
;
if
(
sign
==
-
1
&&
-
e
+
exp
<
-
(
INT_MAX
/
100
))
{
/* The literal will be rounded to 0 anyway. */
while
(
is
w
digit
(
*
ctx
->
ptr
))
while
(
is
_
digit
(
*
ctx
->
ptr
))
ctx
->
ptr
++
;
*
(
double
*
)
ret
=
0
;
return
tDouble
;
...
...
@@ -276,7 +276,7 @@ static int parse_numeric_literal(parser_ctx_t *ctx, void **ret)
FIXME
(
"Invalid numeric literal
\n
"
);
return
0
;
}
}
while
(
is
w
digit
(
*
ctx
->
ptr
));
}
while
(
is
_
digit
(
*
ctx
->
ptr
));
exp
+=
sign
*
e
;
}
...
...
dlls/vbscript/vbregexp.c
View file @
a35adb19
...
...
@@ -1560,14 +1560,14 @@ static HRESULT WINAPI RegExp2_Replace(IRegExp2 *iface, BSTR source, VARIANT repl
default:
{
DWORD
idx
;
if
(
!
is
w
digit
(
ptr
[
1
]))
{
if
(
!
is
_
digit
(
ptr
[
1
]))
{
hres
=
strbuf_append
(
&
buf
,
ptr
,
1
);
prev_ptr
=
ptr
+
1
;
break
;
}
idx
=
ptr
[
1
]
-
'0'
;
if
(
is
w
digit
(
ptr
[
2
])
&&
idx
*
10
+
(
ptr
[
2
]
-
'0'
)
<=
state
->
paren_count
)
{
if
(
is
_
digit
(
ptr
[
2
])
&&
idx
*
10
+
(
ptr
[
2
]
-
'0'
)
<=
state
->
paren_count
)
{
idx
=
idx
*
10
+
(
ptr
[
2
]
-
'0'
);
prev_ptr
=
ptr
+
3
;
}
else
if
(
idx
&&
idx
<=
state
->
paren_count
)
{
...
...
dlls/vbscript/vbscript.h
View file @
a35adb19
...
...
@@ -373,6 +373,11 @@ static inline BOOL is_int32(double d)
return
INT32_MIN
<=
d
&&
d
<=
INT32_MAX
&&
(
double
)(
int
)
d
==
d
;
}
static
inline
BOOL
is_digit
(
WCHAR
c
)
{
return
'0'
<=
c
&&
c
<=
'9'
;
}
HRESULT
create_regexp
(
IDispatch
**
)
DECLSPEC_HIDDEN
;
BSTR
string_replace
(
BSTR
,
BSTR
,
BSTR
,
int
,
int
)
DECLSPEC_HIDDEN
;
...
...
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