Commit 39600d9d authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

msi: Reorder the condition operators so that longer strings are matched first.

This allows ~<< to be properly matched.
parent 694219d4
...@@ -553,14 +553,14 @@ static int COND_GetOperator( COND_input *cond ) ...@@ -553,14 +553,14 @@ static int COND_GetOperator( COND_input *cond )
const WCHAR str[4]; const WCHAR str[4];
int id; int id;
} table[] = { } table[] = {
{ {'~','=',0}, COND_IEQ },
{ {'~','<','=',0}, COND_ILE }, { {'~','<','=',0}, COND_ILE },
{ {'~','>','<',0}, COND_ISS }, { {'~','>','<',0}, COND_ISS },
{ {'~','>','>',0}, COND_IRHS }, { {'~','>','>',0}, COND_IRHS },
{ {'~','<','>',0}, COND_INE }, { {'~','<','>',0}, COND_INE },
{ {'~','<',0}, COND_ILT },
{ {'~','>','=',0}, COND_IGE }, { {'~','>','=',0}, COND_IGE },
{ {'~','<','<',0}, COND_ILHS }, { {'~','<','<',0}, COND_ILHS },
{ {'~','=',0}, COND_IEQ },
{ {'~','<',0}, COND_ILT },
{ {'~','>',0}, COND_IGT }, { {'~','>',0}, COND_IGT },
{ {'>','=',0}, COND_GE }, { {'>','=',0}, COND_GE },
{ {'>','<',0}, COND_SS }, { {'>','<',0}, COND_SS },
......
...@@ -1072,6 +1072,15 @@ static void test_condition(void) ...@@ -1072,6 +1072,15 @@ static void test_condition(void)
r = MsiEvaluateCondition(hpkg, "not LicView"); r = MsiEvaluateCondition(hpkg, "not LicView");
ok( r == MSICONDITION_TRUE, "wrong return val\n"); 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\""); r = MsiEvaluateCondition(hpkg, "not \"A\"");
ok( r == MSICONDITION_FALSE, "wrong return val\n"); ok( r == MSICONDITION_FALSE, "wrong return val\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment