From 382a89c1738367df95fb3772e18bf3531ac85610 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Sun, 24 May 2020 14:18:16 -0600 Subject: [PATCH] pkg: pkgconf_compare_version(): do not return levenshtein distance in strcmp() case --- libpkgconf/pkg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libpkgconf/pkg.c b/libpkgconf/pkg.c index d91ccde..81503e7 100644 --- a/libpkgconf/pkg.c +++ b/libpkgconf/pkg.c @@ -860,8 +860,8 @@ pkgconf_compare_version(const char *a, const char *b) } ret = strcmp(one, two); - if (ret) - return ret; + if (ret != 0) + return ret < 0 ? -1 : 1; *str1 = oldch1; *str2 = oldch2;