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
da20e4d9
Commit
da20e4d9
authored
Nov 02, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Nov 02, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NULL and empty strings are the same in conditions.
parent
e6076846
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
cond.y
dlls/msi/cond.y
+6
-2
package.c
dlls/msi/tests/package.c
+6
-0
No files found.
dlls/msi/cond.y
View file @
da20e4d9
...
@@ -361,6 +361,10 @@ static WCHAR *strstriW( const WCHAR *str, const WCHAR *sub )
...
@@ -361,6 +361,10 @@ static WCHAR *strstriW( const WCHAR *str, const WCHAR *sub )
static
INT
compare_string
(
LPCWSTR
a
,
INT
operator
,
LPCWSTR
b
)
static
INT
compare_string
(
LPCWSTR
a
,
INT
operator
,
LPCWSTR
b
)
{
{
/*
null
and
empty
string
are
equivalent
*/
if
(
!a) a = szEmpty;
if
(
!b) b = szEmpty;
/*
a
or
b
may
be
NULL
*/
/*
a
or
b
may
be
NULL
*/
switch
(
operator
)
switch
(
operator
)
{
{
...
@@ -377,7 +381,7 @@ static INT compare_string( LPCWSTR a, INT operator, LPCWSTR b )
...
@@ -377,7 +381,7 @@ static INT compare_string( LPCWSTR a, INT operator, LPCWSTR b )
case
COND_LE
:
case
COND_LE
:
return
1
!= lstrcmpW( a, b );
return
1
!= lstrcmpW( a, b );
case
COND_SS
:
/*
substring
*/
case
COND_SS
:
/*
substring
*/
return
(
a
&&
b
&&
strstrW
(
a
,
b
)
)
?
1
:
0
;
return
strstrW
(
a
,
b
)
?
1
:
0
;
case
COND_ILT
:
case
COND_ILT
:
return
-
1
==
lstrcmpiW
(
a
,
b
);
return
-
1
==
lstrcmpiW
(
a
,
b
);
case
COND_IGT
:
case
COND_IGT
:
...
@@ -391,7 +395,7 @@ static INT compare_string( LPCWSTR a, INT operator, LPCWSTR b )
...
@@ -391,7 +395,7 @@ static INT compare_string( LPCWSTR a, INT operator, LPCWSTR b )
case
COND_ILE
:
case
COND_ILE
:
return
1
!= lstrcmpiW( a, b );
return
1
!= lstrcmpiW( a, b );
case
COND_ISS
:
case
COND_ISS
:
return
(
a
&&
b
&&
strstriW
(
a
,
b
)
)
?
1
:
0
;
return
strstriW
(
a
,
b
)
?
1
:
0
;
case
COND_LHS
:
case
COND_LHS
:
case
COND_RHS
:
case
COND_RHS
:
case
COND_ILHS
:
case
COND_ILHS
:
...
...
dlls/msi/tests/package.c
View file @
da20e4d9
...
@@ -587,6 +587,12 @@ void test_condition(void)
...
@@ -587,6 +587,12 @@ void test_condition(void)
r
=
MsiEvaluateCondition
(
hpkg
,
"NOT ( 1 AND 1 )"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"NOT ( 1 AND 1 )"
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"NOT A AND (BBBBBBBBBB=2 OR CCC=1) AND Ddddddddd"
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"Installed<>
\"\"
"
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
MsiCloseHandle
(
hpkg
);
MsiCloseHandle
(
hpkg
);
}
}
...
...
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