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
9b02d2d5
Commit
9b02d2d5
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 result in String.substring.
parent
c0156204
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
17 deletions
+8
-17
string.c
dlls/jscript/string.c
+8
-17
No files found.
dlls/jscript/string.c
View file @
9b02d2d5
...
...
@@ -1302,6 +1302,7 @@ static HRESULT String_substring(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
INT
start
=
0
,
end
;
DWORD
length
;
VARIANT
v
;
double
d
;
HRESULT
hres
;
TRACE
(
"
\n
"
);
...
...
@@ -1317,15 +1318,9 @@ static HRESULT String_substring(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
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
((
int
)
d
,
length
)
:
length
;
}
if
(
arg_cnt
(
dp
)
>=
2
)
{
...
...
@@ -1335,15 +1330,11 @@ static HRESULT String_substring(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
return
hres
;
}
if
(
V_VT
(
&
v
)
==
VT_I4
)
{
end
=
V_I4
(
&
v
);
if
(
end
<
0
)
d
=
num_val
(
&
v
);
if
(
d
>=
0
)
end
=
is_int32
(
d
)
?
min
((
int
)
d
,
length
)
:
length
;
else
end
=
0
;
else
if
(
end
>
length
)
end
=
length
;
}
else
{
end
=
V_R8
(
&
v
)
<
0
.
0
?
0
:
length
;
}
}
else
{
end
=
length
;
}
...
...
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