Bug 310976 - Treat 1.5.* as 1.5.infinity r=darin

This commit is contained in:
bsmedberg%covad.net 2005-10-04 02:47:02 +00:00
parent 8b4f326fce
commit e54a5866ab
3 changed files with 12 additions and 1 deletions

View File

@ -45,6 +45,9 @@
*
* <number-a><string-b><number-c><string-d (everything else)>
*
* A version-part may also consist of a single asterisk "*" which indicates
* "infinity".
*
* Numbers are base-10, and are zero if left out.
* Strings are compared bytewise.
*

View File

@ -74,7 +74,13 @@ ParseVP(char *part, VersionPart &result)
if (dot)
*dot = '\0';
result.numA = strtol(part, NS_CONST_CAST(char**, &result.strB), 10);
if (part[0] == '*' && part[1] == '\0') {
result.numA = PR_INT32_MAX;
result.strB = "";
}
else {
result.numA = strtol(part, NS_CONST_CAST(char**, &result.strB), 10);
}
if (!*result.strB) {
result.strB = nsnull;

View File

@ -52,6 +52,8 @@ my $executable = shift;
"1.1",
"1.1.0.1",
"1.1.1",
"1.1.*",
"1.*",
"2.0",
"2.1",
"3.0.-1",