diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-02-10 13:24:03 +0100 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-02-10 13:24:03 +0100 |
commit | 77078276bfe695070441a1bbdc02949d31de8922 (patch) | |
tree | 59b45fb75258d4b0c0ccd1fa659fbc6e4c0e7a09 /src | |
parent | c908371aec920b8174e40a1adb73a50e326a5668 (diff) |
patch 9.1.0093: Still a qsort() comparison function that returns result of subtractionv9.1.0093
Problem: Still a qsort() comparison function fuzzy_match_item_compare()
that returns result of subtraction (after 9.1.0089).
Solution: Use an explicit comparison instead of subtraction.
(zeertzjq)
closes: #14004
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/search.c | 5 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/search.c b/src/search.c index eadbcd3d93..1d0542b658 100644 --- a/src/search.c +++ b/src/search.c @@ -4561,7 +4561,10 @@ fuzzy_match_item_compare(const void *s1, const void *s2) int idx1 = ((fuzzyItem_T *)s1)->idx; int idx2 = ((fuzzyItem_T *)s2)->idx; - return v1 == v2 ? (idx1 - idx2) : v1 > v2 ? -1 : 1; + if (v1 == v2) + return idx1 == idx2 ? 0 : idx1 > idx2 ? 1 : -1; + else + return v1 > v2 ? -1 : 1; } /* diff --git a/src/version.c b/src/version.c index 86ed8b708d..685f8b0df3 100644 --- a/src/version.c +++ b/src/version.c @@ -705,6 +705,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 93, +/**/ 92, /**/ 91, |