summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTollef Fog Heen <tfheen@err.no>2010-05-08 22:15:36 +0200
committerTollef Fog Heen <tfheen@err.no>2010-05-08 22:15:36 +0200
commit726f8e4c136c61c13366a3821aa9a48dd5e5f03f (patch)
tree6b7441cfbcbf5a2b80a4a3f6b473ea6644f1a541
parent66d49f1375fec838bcd301bb4ca2ef76cee0e47c (diff)
downloadpkg-config-726f8e4c136c61c13366a3821aa9a48dd5e5f03f.tar.gz
Update rpmvercmp with bugfixes from RPM
Grab two minor bugfixes from RPM's rpmvercmp.
-rw-r--r--pkg.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg.c b/pkg.c
index 0409531..3689cae 100644
--- a/pkg.c
+++ b/pkg.c
@@ -1323,6 +1323,9 @@ static int rpmvercmp(const char * a, const char * b) {
while (*one && !isalnum((guchar)*one)) one++;
while (*two && !isalnum((guchar)*two)) two++;
+ /* If we ran to the end of either, we are finished with the loop */
+ if (!(*one && *two)) break;
+
str1 = one;
str2 = two;
@@ -1349,7 +1352,8 @@ static int rpmvercmp(const char * a, const char * b) {
/* take care of the case where the two version segments are */
/* different types: one numeric and one alpha */
if (one == str1) return -1; /* arbitrary */
- if (two == str2) return -1;
+ /* XXX See patch #60884 (and details) from bugzilla #50977. */
+ if (two == str2) return (isnum ? 1 : -1);
if (isnum) {
/* this used to be done by converting the digit segments */