mirror of
https://gitlab.freedesktop.org/pkg-config/pkg-config.git
synced 2025-12-20 05:30:03 +01:00
rpmvercmp: Return -1/0/1 as function says it will
strcmp is only guaranteed to return !0 when the strings are unmatched while rpmvercmp says it will return only -1 or 1 in those cases. pkg-config currently only checks for !0, so this doesn't actually fix any issues here. However, this is harmless and helps minimize the diff with upstream rpmvercmp. http://rpm.org/gitweb?p=rpm.git;a=commitdiff;h=ee64849e
This commit is contained in:
parent
f50ba60ceb
commit
f78b014371
1 changed files with 1 additions and 1 deletions
|
|
@ -106,7 +106,7 @@ int rpmvercmp(const char * a, const char * b)
|
|||
/* if they are equal because there might be more segments to */
|
||||
/* compare */
|
||||
rc = strcmp(one, two);
|
||||
if (rc) return rc;
|
||||
if (rc) return (rc < 1 ? -1 : 1);
|
||||
|
||||
/* restore character that was replaced by null above */
|
||||
*str1 = oldch1;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue