diff options
author | Bob Arnson <bob@firegiant.com> | 2021-03-07 19:28:18 -0500 |
---|---|---|
committer | Bob Arnson <bob@firegiant.com> | 2021-03-07 19:31:22 -0500 |
commit | 838d10a319d0c35ed71fcd3e14d2a830883dbbbd (patch) | |
tree | 69522bd7225c799adba4ce2c7143a6d1a0718b32 | |
parent | 7f128f4639b6a14217780d69a0615b44d36f2f1b (diff) | |
download | wix-838d10a319d0c35ed71fcd3e14d2a830883dbbbd.tar.gz wix-838d10a319d0c35ed71fcd3e14d2a830883dbbbd.tar.bz2 wix-838d10a319d0c35ed71fcd3e14d2a830883dbbbd.zip |
Correctly handle missing/null values with ~<> operator.
(That's case-insensitive non-equal.)
Fixes https://github.com/wixtoolset/issues/issues/5372
-rw-r--r-- | src/engine/condition.cpp | 2 | ||||
-rw-r--r-- | src/test/BurnUnitTest/VariableTest.cpp | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/engine/condition.cpp b/src/engine/condition.cpp index 316224db..56fe76c2 100644 --- a/src/engine/condition.cpp +++ b/src/engine/condition.cpp | |||
@@ -896,7 +896,7 @@ static HRESULT CompareOperands( | |||
896 | else | 896 | else |
897 | { | 897 | { |
898 | // not a combination that can be compared | 898 | // not a combination that can be compared |
899 | *pfResult = (BURN_SYMBOL_TYPE_NE == comparison); | 899 | *pfResult = (BURN_SYMBOL_TYPE_NE == comparison || BURN_SYMBOL_TYPE_NE_I == comparison); |
900 | } | 900 | } |
901 | 901 | ||
902 | LExit: | 902 | LExit: |
diff --git a/src/test/BurnUnitTest/VariableTest.cpp b/src/test/BurnUnitTest/VariableTest.cpp index 676c134e..ab45a73f 100644 --- a/src/test/BurnUnitTest/VariableTest.cpp +++ b/src/test/BurnUnitTest/VariableTest.cpp | |||
@@ -258,7 +258,10 @@ namespace Bootstrapper | |||
258 | Assert::True(EvaluateConditionHelper(&variables, L"PROP1 = \"VAL1\"")); | 258 | Assert::True(EvaluateConditionHelper(&variables, L"PROP1 = \"VAL1\"")); |
259 | Assert::False(EvaluateConditionHelper(&variables, L"NONE = \"NOT\"")); | 259 | Assert::False(EvaluateConditionHelper(&variables, L"NONE = \"NOT\"")); |
260 | Assert::False(EvaluateConditionHelper(&variables, L"PROP1 <> \"VAL1\"")); | 260 | Assert::False(EvaluateConditionHelper(&variables, L"PROP1 <> \"VAL1\"")); |
261 | Assert::False(EvaluateConditionHelper(&variables, L"PROP1 ~<> \"VAL1\"")); | ||
262 | Assert::False(EvaluateConditionHelper(&variables, L"PROP1 ~<> \"Val1\"")); | ||
261 | Assert::True(EvaluateConditionHelper(&variables, L"NONE <> \"NOT\"")); | 263 | Assert::True(EvaluateConditionHelper(&variables, L"NONE <> \"NOT\"")); |
264 | Assert::True(EvaluateConditionHelper(&variables, L"NONE ~<> \"NOT\"")); | ||
262 | 265 | ||
263 | Assert::True(EvaluateConditionHelper(&variables, L"PROP1 ~= \"val1\"")); | 266 | Assert::True(EvaluateConditionHelper(&variables, L"PROP1 ~= \"val1\"")); |
264 | Assert::False(EvaluateConditionHelper(&variables, L"PROP1 = \"val1\"")); | 267 | Assert::False(EvaluateConditionHelper(&variables, L"PROP1 = \"val1\"")); |