Module: wine Branch: master Commit: 39600d9d2e3e5fb7cd34d913f1870d8d6f0362de URL: http://source.winehq.org/git/wine.git/?a=commit;h=39600d9d2e3e5fb7cd34d913f1...
Author: Aric Stewart aric@codeweavers.com Date: Mon Mar 16 11:05:11 2009 -0500
msi: Reorder the condition operators so that longer strings are matched first.
This allows ~<< to be properly matched.
---
dlls/msi/cond.y | 4 ++-- dlls/msi/tests/package.c | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/dlls/msi/cond.y b/dlls/msi/cond.y index 7eb48c5..8831208 100644 --- a/dlls/msi/cond.y +++ b/dlls/msi/cond.y @@ -553,14 +553,14 @@ static int COND_GetOperator( COND_input *cond ) const WCHAR str[4]; int id; } table[] = { - { {'~','=',0}, COND_IEQ }, { {'~','<','=',0}, COND_ILE }, { {'~','>','<',0}, COND_ISS }, { {'~','>','>',0}, COND_IRHS }, { {'~','<','>',0}, COND_INE }, - { {'~','<',0}, COND_ILT }, { {'~','>','=',0}, COND_IGE }, { {'~','<','<',0}, COND_ILHS }, + { {'~','=',0}, COND_IEQ }, + { {'~','<',0}, COND_ILT }, { {'~','>',0}, COND_IGT }, { {'>','=',0}, COND_GE }, { {'>','<',0}, COND_SS }, diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c index 3cb5d1d..2696dc2 100644 --- a/dlls/msi/tests/package.c +++ b/dlls/msi/tests/package.c @@ -1072,6 +1072,15 @@ static void test_condition(void) r = MsiEvaluateCondition(hpkg, "not LicView"); ok( r == MSICONDITION_TRUE, "wrong return val\n");
+ r = MsiEvaluateCondition(hpkg, ""Testing" ~<< "Testing""); + ok (r == MSICONDITION_TRUE, "wrong return val\n"); + + r = MsiEvaluateCondition(hpkg, "LicView ~<< "Testing""); + ok (r == MSICONDITION_FALSE, "wrong return val\n"); + + r = MsiEvaluateCondition(hpkg, "Not LicView ~<< "Testing""); + ok (r == MSICONDITION_TRUE, "wrong return val\n"); + r = MsiEvaluateCondition(hpkg, "not "A""); ok( r == MSICONDITION_FALSE, "wrong return val\n");