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
0cb6bf5b
Commit
0cb6bf5b
authored
Jul 12, 2009
by
Piotr Caban
Committed by
Alexandre Julliard
Jul 13, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Make String_match generic.
parent
4881cf8d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
5 deletions
+36
-5
string.c
dlls/jscript/string.c
+36
-5
No files found.
dlls/jscript/string.c
View file @
0cb6bf5b
...
...
@@ -585,12 +585,13 @@ static HRESULT String_link(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS
static
HRESULT
String_match
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
)
{
StringInstance
*
This
=
(
StringInstance
*
)
dispex
;
const
WCHAR
*
str
;
match_result_t
*
match_result
;
DispatchEx
*
regexp
;
DispatchEx
*
array
;
VARIANT
var
,
*
arg_var
;
DWORD
match_cnt
,
i
;
DWORD
length
,
match_cnt
,
i
;
BSTR
val_str
;
HRESULT
hres
=
S_OK
;
TRACE
(
"
\n
"
);
...
...
@@ -623,22 +624,50 @@ static HRESULT String_match(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM
}
}
hres
=
regexp_match
(
regexp
,
This
->
str
,
This
->
length
,
FALSE
,
&
match_result
,
&
match_cnt
);
if
(
!
is_class
(
dispex
,
JSCLASS_STRING
))
{
VARIANT
this
;
V_VT
(
&
this
)
=
VT_DISPATCH
;
V_DISPATCH
(
&
this
)
=
(
IDispatch
*
)
_IDispatchEx_
(
dispex
);
hres
=
to_string
(
dispex
->
ctx
,
&
this
,
ei
,
&
val_str
);
if
(
FAILED
(
hres
))
{
jsdisp_release
(
regexp
);
return
hres
;
}
str
=
val_str
;
length
=
SysStringLen
(
val_str
);
}
else
{
StringInstance
*
this
=
(
StringInstance
*
)
dispex
;
str
=
this
->
str
;
length
=
this
->
length
;
}
hres
=
regexp_match
(
regexp
,
str
,
length
,
FALSE
,
&
match_result
,
&
match_cnt
);
jsdisp_release
(
regexp
);
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
{
SysFreeString
(
val_str
);
return
hres
;
}
if
(
!
match_cnt
)
{
TRACE
(
"no match
\n
"
);
if
(
retv
)
V_VT
(
retv
)
=
VT_NULL
;
SysFreeString
(
val_str
);
return
S_OK
;
}
hres
=
create_array
(
dispex
->
ctx
,
match_cnt
,
&
array
);
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
{
SysFreeString
(
val_str
);
return
hres
;
}
V_VT
(
&
var
)
=
VT_BSTR
;
...
...
@@ -655,6 +684,8 @@ static HRESULT String_match(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM
break
;
}
SysFreeString
(
val_str
);
if
(
SUCCEEDED
(
hres
)
&&
retv
)
{
V_VT
(
retv
)
=
VT_DISPATCH
;
V_DISPATCH
(
retv
)
=
(
IDispatch
*
)
_IDispatchEx_
(
array
);
...
...
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