forked from ariadne/pkgconf
pkg: fix up pkg_compare_version()
parent
7e26842094
commit
a872c7254b
6
pkg.c
6
pkg.c
|
@ -62,7 +62,7 @@ pkg_compare_version(const char *a, const char *b)
|
||||||
while (*one && !isalnum(*one))
|
while (*one && !isalnum(*one))
|
||||||
one++;
|
one++;
|
||||||
while (*two && !isalnum(*two))
|
while (*two && !isalnum(*two))
|
||||||
one++;
|
two++;
|
||||||
|
|
||||||
if (!(*one && *two))
|
if (!(*one && *two))
|
||||||
break;
|
break;
|
||||||
|
@ -116,9 +116,9 @@ pkg_compare_version(const char *a, const char *b)
|
||||||
onelen = strlen(one);
|
onelen = strlen(one);
|
||||||
twolen = strlen(two);
|
twolen = strlen(two);
|
||||||
|
|
||||||
if (one > two)
|
if (onelen > twolen)
|
||||||
return 1;
|
return 1;
|
||||||
else if (two > one)
|
else if (twolen > onelen)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue