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
392736c5
Commit
392736c5
authored
Jun 29, 2015
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 29, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Treat empty regexp pattern the same way as NULL pattern.
parent
e27a13e3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
17 deletions
+28
-17
regexp.vbs
dlls/vbscript/tests/regexp.vbs
+17
-0
vbregexp.c
dlls/vbscript/vbregexp.c
+11
-17
No files found.
dlls/vbscript/tests/regexp.vbs
View file @
392736c5
...
@@ -174,4 +174,21 @@ Call ok(x.IgnoreCase = false, "RegExp.IgnoreCase = " & x.IgnoreCase)
...
@@ -174,4 +174,21 @@ Call ok(x.IgnoreCase = false, "RegExp.IgnoreCase = " & x.IgnoreCase)
Call
ok
(
x
.
Global
=
false
,
"RegExp.Global = "
&
x
.
Global
)
Call
ok
(
x
.
Global
=
false
,
"RegExp.Global = "
&
x
.
Global
)
Call
ok
(
x
.
Multiline
=
false
,
"RegExp.Multiline = "
&
x
.
Multiline
)
Call
ok
(
x
.
Multiline
=
false
,
"RegExp.Multiline = "
&
x
.
Multiline
)
set
matches
=
x
.
execute
(
"test"
)
Call
ok
(
matches
.
Count
=
1
,
"matches.Count = "
&
matches
.
Count
)
x
.
pattern
=
""
set
matches
=
x
.
execute
(
"test"
)
Call
ok
(
matches
.
Count
=
1
,
"matches.Count = "
&
matches
.
Count
)
set
match
=
matches
.
item
(
0
)
Call
ok
(
match
.
Value
=
""
,
"match.Value = "
&
match
.
Value
)
x
.
global
=
true
set
matches
=
x
.
execute
(
"test"
)
Call
ok
(
matches
.
Count
=
5
,
"matches.Count = "
&
matches
.
Count
)
set
match
=
matches
.
item
(
0
)
Call
ok
(
match
.
Value
=
""
,
"match.Value = "
&
match
.
Value
)
set
match
=
matches
.
item
(
4
)
Call
ok
(
match
.
Value
=
""
,
"match.Value = "
&
match
.
Value
)
matches
=
x
.
test
(
"test"
)
Call
ok
(
matches
=
true
,
"matches = "
&
matches
)
Call
reportSuccess
()
Call
reportSuccess
()
dlls/vbscript/vbregexp.c
View file @
392736c5
...
@@ -1189,29 +1189,23 @@ static HRESULT WINAPI RegExp2_get_Pattern(IRegExp2 *iface, BSTR *pPattern)
...
@@ -1189,29 +1189,23 @@ static HRESULT WINAPI RegExp2_get_Pattern(IRegExp2 *iface, BSTR *pPattern)
static
HRESULT
WINAPI
RegExp2_put_Pattern
(
IRegExp2
*
iface
,
BSTR
pattern
)
static
HRESULT
WINAPI
RegExp2_put_Pattern
(
IRegExp2
*
iface
,
BSTR
pattern
)
{
{
RegExp2
*
This
=
impl_from_IRegExp2
(
iface
);
RegExp2
*
This
=
impl_from_IRegExp2
(
iface
);
WCHAR
*
p
;
WCHAR
*
new_pattern
;
DWORD
size
;
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
wine_dbgstr_w
(
pattern
));
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
wine_dbgstr_w
(
pattern
));
if
(
!
pattern
)
{
if
(
pattern
&&
*
pattern
)
{
heap_free
(
This
->
pattern
);
SIZE_T
size
=
(
SysStringLen
(
pattern
)
+
1
)
*
sizeof
(
WCHAR
);
if
(
This
->
regexp
)
{
new_pattern
=
heap_alloc
(
size
);
regexp_destroy
(
This
->
regexp
);
if
(
!
new_pattern
)
This
->
regexp
=
NULL
;
}
This
->
pattern
=
NULL
;
return
S_OK
;
}
size
=
(
SysStringLen
(
pattern
)
+
1
)
*
sizeof
(
WCHAR
);
p
=
heap_alloc
(
size
);
if
(
!
p
)
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
memcpy
(
new_pattern
,
pattern
,
size
);
}
else
{
new_pattern
=
NULL
;
}
heap_free
(
This
->
pattern
);
heap_free
(
This
->
pattern
);
This
->
pattern
=
p
;
This
->
pattern
=
new_pattern
;
memcpy
(
p
,
pattern
,
size
);
if
(
This
->
regexp
)
{
if
(
This
->
regexp
)
{
regexp_destroy
(
This
->
regexp
);
regexp_destroy
(
This
->
regexp
);
This
->
regexp
=
NULL
;
This
->
regexp
=
NULL
;
...
...
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