diff --git a/mozilla/xpcom/base/nsIVersionComparator.idl b/mozilla/xpcom/base/nsIVersionComparator.idl index fa0f6952a22..1ada0ef17b3 100755 --- a/mozilla/xpcom/base/nsIVersionComparator.idl +++ b/mozilla/xpcom/base/nsIVersionComparator.idl @@ -45,6 +45,9 @@ * * * + * 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. * diff --git a/mozilla/xpcom/glue/nsVersionComparator.cpp b/mozilla/xpcom/glue/nsVersionComparator.cpp index 81429ec0dab..2ceb68c6966 100755 --- a/mozilla/xpcom/glue/nsVersionComparator.cpp +++ b/mozilla/xpcom/glue/nsVersionComparator.cpp @@ -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; diff --git a/mozilla/xpcom/tests/TestVersionComparatorRunner.pl b/mozilla/xpcom/tests/TestVersionComparatorRunner.pl index 0e8f012e905..54cbb8770c4 100755 --- a/mozilla/xpcom/tests/TestVersionComparatorRunner.pl +++ b/mozilla/xpcom/tests/TestVersionComparatorRunner.pl @@ -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",