Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
e26a3018
Commit
e26a3018
authored
May 03, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
May 03, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Better handling of to_integer in String.substr.
parent
9b02d2d5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
18 deletions
+9
-18
string.c
dlls/jscript/string.c
+9
-18
No files found.
dlls/jscript/string.c
View file @
e26a3018
...
...
@@ -1366,6 +1366,7 @@ static HRESULT String_substr(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DIS
INT
start
=
0
,
len
;
DWORD
length
;
VARIANT
v
;
double
d
;
HRESULT
hres
;
TRACE
(
"
\n
"
);
...
...
@@ -1381,15 +1382,9 @@ static HRESULT String_substr(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DIS
return
hres
;
}
if
(
V_VT
(
&
v
)
==
VT_I4
)
{
start
=
V_I4
(
&
v
);
if
(
start
<
0
)
start
=
0
;
else
if
(
start
>=
length
)
start
=
length
;
}
else
{
start
=
V_R8
(
&
v
)
<
0
.
0
?
0
:
length
;
}
d
=
num_val
(
&
v
);
if
(
d
>=
0
)
start
=
is_int32
(
d
)
?
min
(
length
,
d
)
:
length
;
}
if
(
arg_cnt
(
dp
)
>=
2
)
{
...
...
@@ -1399,15 +1394,11 @@ static HRESULT String_substr(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DIS
return
hres
;
}
if
(
V_VT
(
&
v
)
==
VT_I4
)
{
len
=
V_I4
(
&
v
);
if
(
len
<
0
)
len
=
0
;
else
if
(
len
>
length
-
start
)
len
=
length
-
start
;
}
else
{
len
=
V_R8
(
&
v
)
<
0
.
0
?
0
:
length
-
start
;
}
d
=
num_val
(
&
v
);
if
(
d
>=
0
.
0
)
len
=
is_int32
(
d
)
?
min
(
length
-
start
,
d
)
:
length
-
start
;
else
len
=
0
;
}
else
{
len
=
length
-
start
;
}
...
...
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