diff options
author | Rob Mensching <rob@firegiant.com> | 2022-10-02 19:26:26 -0700 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2022-10-04 10:44:49 -0700 |
commit | 15e332b88cb473d911cb268580400728014dd01b (patch) | |
tree | a6d366fbddf3685274fd2e6abc9d0566db42b022 /src/libs | |
parent | 05f2de99258c81b2781a9dd30847a00242f53180 (diff) | |
download | wix-15e332b88cb473d911cb268580400728014dd01b.tar.gz wix-15e332b88cb473d911cb268580400728014dd01b.tar.bz2 wix-15e332b88cb473d911cb268580400728014dd01b.zip |
Fix verutil string comparisons
Invariant string comparisons were finding strings like "abc" to be
less than "-abc". Switching to ordinal comparison correctly reports
the order.
Diffstat (limited to 'src/libs')
-rw-r--r-- | src/libs/dutil/WixToolset.DUtil/verutil.cpp | 2 | ||||
-rw-r--r-- | src/libs/dutil/test/DUtilUnitTest/VerUtilTests.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libs/dutil/WixToolset.DUtil/verutil.cpp b/src/libs/dutil/WixToolset.DUtil/verutil.cpp index 276441b5..e6ef5039 100644 --- a/src/libs/dutil/WixToolset.DUtil/verutil.cpp +++ b/src/libs/dutil/WixToolset.DUtil/verutil.cpp | |||
@@ -660,7 +660,7 @@ static HRESULT CompareVersionSubstring( | |||
660 | HRESULT hr = S_OK; | 660 | HRESULT hr = S_OK; |
661 | int nResult = 0; | 661 | int nResult = 0; |
662 | 662 | ||
663 | nResult = ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, wzString1, cchCount1, wzString2, cchCount2); | 663 | nResult = ::CompareStringOrdinal(wzString1, cchCount1, wzString2, cchCount2, TRUE); |
664 | if (!nResult) | 664 | if (!nResult) |
665 | { | 665 | { |
666 | VerExitOnLastError(hr, "Failed to compare version substrings"); | 666 | VerExitOnLastError(hr, "Failed to compare version substrings"); |
diff --git a/src/libs/dutil/test/DUtilUnitTest/VerUtilTests.cpp b/src/libs/dutil/test/DUtilUnitTest/VerUtilTests.cpp index f4085c33..3e414006 100644 --- a/src/libs/dutil/test/DUtilUnitTest/VerUtilTests.cpp +++ b/src/libs/dutil/test/DUtilUnitTest/VerUtilTests.cpp | |||
@@ -606,7 +606,7 @@ namespace DutilTests | |||
606 | 606 | ||
607 | TestVerutilCompareParsedVersions(pVersion1, pVersion2, 1); | 607 | TestVerutilCompareParsedVersions(pVersion1, pVersion2, 1); |
608 | TestVerutilCompareParsedVersions(pVersion1, pVersion3, 1); | 608 | TestVerutilCompareParsedVersions(pVersion1, pVersion3, 1); |
609 | TestVerutilCompareParsedVersions(pVersion2, pVersion3, -1); | 609 | TestVerutilCompareParsedVersions(pVersion2, pVersion3, 1); |
610 | } | 610 | } |
611 | finally | 611 | finally |
612 | { | 612 | { |