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
fadc820f
Commit
fadc820f
authored
Dec 14, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "msi: Comparisons with null in conditions are special."
This reverts commit
9dce96b3
.
parent
598f2be5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
72 deletions
+27
-72
cond.y
dlls/msi/cond.y
+27
-72
No files found.
dlls/msi/cond.y
View file @
fadc820f
...
...
@@ -431,104 +431,59 @@ static INT compare_substring( LPCWSTR a, INT operator, LPCWSTR b )
case
COND_ISS
:
return
strstriW
(
a
,
b
)
?
1
:
0
;
case
COND_LHS
:
return
0
==
strncmpW
(
a
,
b
,
lstrlenW
(
b
)
);
return
0
==
strncmpW
(
a
,
b
,
lstrlenW
(
b
)
);
case
COND_RHS
:
return
0
==
lstrcmpW
(
a
+
(
lstrlenW
(
a
)
-
lstrlenW
(
b
)),
b
);
return
0
==
lstrcmpW
(
a
+
(
lstrlenW
(
a
)
-
lstrlenW
(
b
)),
b
);
case
COND_ILHS
:
return
0
==
strncmpiW
(
a
,
b
,
lstrlenW
(
b
)
);
return
0
==
strncmpiW
(
a
,
b
,
lstrlenW
(
b
)
);
case
COND_IRHS
:
return
0
==
lstrcmpiW
(
a
+
(
lstrlenW
(
a
)
-
lstrlenW
(
b
)),
b
);
default
:
ERR
(
"invalid substring operator
\n
"
);
ERR
(
"invalid substring operator
\n
"
);
return
0
;
}
return
0
;
}
static
BOOL
is_empty
(
LPCWSTR
p
)
{
return
!p || !p[0];
}
static
BOOL
is_alphaless
(
LPCWSTR
p
)
{
while
(*
p
)
{
if
(
isalphaW
(
*
p
)
||
(*
p
==
'_'
))
return
FALSE
;
p
++;
}
return
TRUE
;
}
static
INT
compare_string
(
LPCWSTR
a
,
INT
operator
,
LPCWSTR
b
)
{
int
r
;
if
(
operator
>=
COND_SS
&&
operator
<=
COND_RHS
)
return
compare_substring
(
a
,
operator
,
b
);
/*
null
and
empty
string
are
equivalent
*/
if
(
!a) a = szEmpty;
if
(
!b) b = szEmpty;
if
(
is_empty
(
a
)
&&
is_empty
(
b
))
r
=
0
;
else
if
(
is_empty
(
a
)
&&
is_alphaless
(
b
))
r
=
1
;
else
if
(
is_empty
(
b
)
&&
is_alphaless
(
a
))
r
=
-
1
;
else
{
/*
null
and
empty
string
are
equivalent
*/
if
(
!a) a = szEmpty;
if
(
!b) b = szEmpty;
switch
(
operator
)
{
case
COND_LT
:
case
COND_GT
:
case
COND_EQ
:
case
COND_NE
:
case
COND_GE
:
case
COND_LE
:
r
=
lstrcmpW
(
a
,
b
);
break
;
case
COND_ILT
:
case
COND_IGT
:
case
COND_IEQ
:
case
COND_INE
:
case
COND_IGE
:
case
COND_ILE
:
r
=
lstrcmpiW
(
a
,
b
);
break
;
default
:
ERR
(
"invalid string operator
\n
"
);
return
0
;
}
}
/*
a
or
b
may
be
NULL
*/
switch
(
operator
)
{
case
COND_LT
:
case
COND_ILT
:
return
-
1
==
r
;
return
-
1
==
lstrcmpW
(
a
,
b
);
case
COND_GT
:
case
COND_IGT
:
return
1
==
r
;
return
1
==
lstrcmpW
(
a
,
b
);
case
COND_EQ
:
case
COND_IEQ
:
return
0
==
r
;
return
0
==
lstrcmpW
(
a
,
b
);
case
COND_NE
:
case
COND_INE
:
return
0
!= r;
return
0
!= lstrcmpW( a, b );
case
COND_GE
:
case
COND_IGE
:
return
-
1
!= r;
return
-
1
!= lstrcmpW( a, b );
case
COND_LE
:
return
1
!= lstrcmpW( a, b );
case
COND_ILT
:
return
-
1
==
lstrcmpiW
(
a
,
b
);
case
COND_IGT
:
return
1
==
lstrcmpiW
(
a
,
b
);
case
COND_IEQ
:
return
0
==
lstrcmpiW
(
a
,
b
);
case
COND_INE
:
return
0
!= lstrcmpiW( a, b );
case
COND_IGE
:
return
-
1
!= lstrcmpiW( a, b );
case
COND_ILE
:
return
1
!=
r
;
return
1
!=
lstrcmpiW( a, b )
;
default
:
ERR
(
"invalid string operator
\n
"
);
return
0
;
}
return
0
;
}
...
...
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