diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2021-03-30 17:15:25 -0500 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2021-03-30 17:19:19 -0500 |
| commit | ed0ef472c76ac0d2a3d7a138e4f3b7ad950a56bc (patch) | |
| tree | 0b409592d759b43f583b44d2d854d8c44199bcee /src/dutil/verutil.cpp | |
| parent | 10ebf674da5df9224e4eddd3545518434c5b455b (diff) | |
| download | wix-ed0ef472c76ac0d2a3d7a138e4f3b7ad950a56bc.tar.gz wix-ed0ef472c76ac0d2a3d7a138e4f3b7ad950a56bc.tar.bz2 wix-ed0ef472c76ac0d2a3d7a138e4f3b7ad950a56bc.zip | |
Add test for apuputil and fix descending sorting.
Diffstat (limited to 'src/dutil/verutil.cpp')
| -rw-r--r-- | src/dutil/verutil.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/dutil/verutil.cpp b/src/dutil/verutil.cpp index 835dde81..fdb5a10a 100644 --- a/src/dutil/verutil.cpp +++ b/src/dutil/verutil.cpp | |||
| @@ -40,8 +40,8 @@ static HRESULT CompareVersionSubstring( | |||
| 40 | 40 | ||
| 41 | 41 | ||
| 42 | DAPI_(HRESULT) VerCompareParsedVersions( | 42 | DAPI_(HRESULT) VerCompareParsedVersions( |
| 43 | __in VERUTIL_VERSION* pVersion1, | 43 | __in_opt VERUTIL_VERSION* pVersion1, |
| 44 | __in VERUTIL_VERSION* pVersion2, | 44 | __in_opt VERUTIL_VERSION* pVersion2, |
| 45 | __out int* pnResult | 45 | __out int* pnResult |
| 46 | ) | 46 | ) |
| 47 | { | 47 | { |
| @@ -50,8 +50,8 @@ DAPI_(HRESULT) VerCompareParsedVersions( | |||
| 50 | DWORD cMaxReleaseLabels = 0; | 50 | DWORD cMaxReleaseLabels = 0; |
| 51 | BOOL fCompareMetadata = FALSE; | 51 | BOOL fCompareMetadata = FALSE; |
| 52 | 52 | ||
| 53 | if (!pVersion1 || !pVersion1->sczVersion || | 53 | if (pVersion1 && !pVersion1->sczVersion || |
| 54 | !pVersion2 || !pVersion2->sczVersion) | 54 | pVersion2 && !pVersion2->sczVersion) |
| 55 | { | 55 | { |
| 56 | ExitFunction1(hr = E_INVALIDARG); | 56 | ExitFunction1(hr = E_INVALIDARG); |
| 57 | } | 57 | } |
| @@ -60,6 +60,14 @@ DAPI_(HRESULT) VerCompareParsedVersions( | |||
| 60 | { | 60 | { |
| 61 | ExitFunction1(nResult = 0); | 61 | ExitFunction1(nResult = 0); |
| 62 | } | 62 | } |
| 63 | else if (pVersion1 && !pVersion2) | ||
| 64 | { | ||
| 65 | ExitFunction1(nResult = 1); | ||
| 66 | } | ||
| 67 | else if (!pVersion1 && pVersion2) | ||
| 68 | { | ||
| 69 | ExitFunction1(nResult = -1); | ||
| 70 | } | ||
| 63 | 71 | ||
| 64 | nResult = CompareDword(pVersion1->dwMajor, pVersion2->dwMajor); | 72 | nResult = CompareDword(pVersion1->dwMajor, pVersion2->dwMajor); |
| 65 | if (0 != nResult) | 73 | if (0 != nResult) |
