From: Ingo Weinhold Date: Mon, 20 May 2013 14:35:27 +0000 (+0200) Subject: solv_vercmp_haiku(): Fix unnormalized return value X-Git-Tag: BASE-SuSE-Code-13_1-Branch~80 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=837ed96f03db68d8d7a1ac440f1df116436503ee;p=thirdparty%2Flibsolv.git solv_vercmp_haiku(): Fix unnormalized return value The function is required to return -1, 0, or 1, the return value of the called solv_cmp_version_part_haiku() isn't normalized this way, though. --- diff --git a/src/evr.c b/src/evr.c index e8fd12d8..302c44d6 100644 --- a/src/evr.c +++ b/src/evr.c @@ -284,7 +284,8 @@ solv_vercmp_haiku(const char *s1, const char *q1, const char *s2, const char *q2 if (pre2 == q2) return -1; - return solv_cmp_version_part_haiku(pre1 + 1, q1, pre2 + 1, q2); + cmp = solv_cmp_version_part_haiku(pre1 + 1, q1, pre2 + 1, q2); + return cmp == 0 ? 0 : cmp < 0 ? -1 : 1; /* must return -1, 0, or 1 */ } #endif /* HAIKU */