Piotr Caban : msi: Fix condition evaluation when comparing literal and integer.
Alexandre Julliard
julliard at winehq.org
Thu Sep 13 03:49:17 CDT 2018
Module: wine
Branch: stable
Commit: c32f85c5f41989d532cc730ff1d6f585111a9692
URL: https://source.winehq.org/git/wine.git/?a=commit;h=c32f85c5f41989d532cc730ff1d6f585111a9692
Author: Piotr Caban <piotr at codeweavers.com>
Date: Fri Jul 13 13:12:51 2018 +0200
msi: Fix condition evaluation when comparing literal and integer.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45445
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 7837ae20cdeabab661da7bb5dae24f5ffefe17ee)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
dlls/msi/cond.y | 2 +-
dlls/msi/tests/package.c | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/msi/cond.y b/dlls/msi/cond.y
index 6ee6ab9..3a0d028 100644
--- a/dlls/msi/cond.y
+++ b/dlls/msi/cond.y
@@ -218,7 +218,7 @@ boolean_factor:
}
else if ($1.type == VALUE_LITERAL || $3.type == VALUE_LITERAL)
{
- $$ = FALSE;
+ $$ = ($2 == COND_NE || $2 == COND_INE );
}
else if ($1.type == VALUE_SYMBOL) /* symbol operator integer */
{
diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c
index 2022953..cfd5489 100644
--- a/dlls/msi/tests/package.c
+++ b/dlls/msi/tests/package.c
@@ -2071,6 +2071,10 @@ static void test_condition(void)
ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
r = MsiEvaluateConditionA(hpkg, "&nofeature=\"\"");
ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
+ r = MsiEvaluateConditionA(hpkg, "&nofeature<>3");
+ ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
+ r = MsiEvaluateConditionA(hpkg, "\"\"<>3");
+ ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
r = MsiEvaluateConditionA(hpkg, "!nofeature=\"\"");
ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
MsiEvaluateConditionA(hpkg, "$nocomponent=\"\"");
More information about the wine-cvs
mailing list