pkg: fix up pkg_compare_version()

pull/1/merge
William Pitcock 2011-07-26 12:05:14 -05:00
parent 7e26842094
commit a872c7254b
1 changed files with 3 additions and 3 deletions

6
pkg.c
View File

@ -62,7 +62,7 @@ pkg_compare_version(const char *a, const char *b)
while (*one && !isalnum(*one))
one++;
while (*two && !isalnum(*two))
one++;
two++;
if (!(*one && *two))
break;
@ -116,9 +116,9 @@ pkg_compare_version(const char *a, const char *b)
onelen = strlen(one);
twolen = strlen(two);
if (one > two)
if (onelen > twolen)
return 1;
else if (two > one)
else if (twolen > onelen)
return -1;
}