Allow for java.version consisting of four dotted segments

...like "11.0.14.1" reported now by
java-11-openjdk-headless-11.0.14.1.1-5.fc35.x86_64, and which caused

> warn:jfw:274674:274674:jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx💯 [Java framework] sunjavaplugin.so does not know the version: 11.0.14.1 as valid for a SUN/Oracle JRE.

(For simplicity, cover it with the same code block that already covers a
potential "_01" etc. part following the official(?) three dotted segments.)

Change-Id: Id98235d3be59653ab412f9b6c1ffbf3b0470bd6f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131586
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann
2022-03-15 12:17:30 +01:00
parent 25fee1f66b
commit 8e6462571b

View File

@@ -72,8 +72,8 @@ bool SunVersion::init(const char *szVersion)
//separators after maintenance (1.4.1_01, 1.4.1-beta, or 1.4.1)
(pCur == pEnd || *pCur == '_' || *pCur == '-')
||
//separators between major-minor and minor-maintenance
(nPart < 2 && *pCur == '.') )
//separators between major-minor and minor-maintenance (or fourth segment)
(nPart < 3 && *pCur == '.') )
&& (
//prevent 1.4.0. 1.4.0-
pCur + 1 != pEnd
@@ -113,10 +113,10 @@ bool SunVersion::init(const char *szVersion)
}
if (pCur >= pEnd)
return true;
//We have now 1.4.1. This can be followed by _01, -beta, etc.
//We have now 1.4.1. This can be followed by _01 (or a fourth segment .1), -beta, etc.
// _01 (update) According to docu must not be followed by any other
//characters, but on Solaris 9 we have a 1.4.1_01a!!
if (* (pCur - 1) == '_')
if (* (pCur - 1) == '_' || *(pCur - 1) == '.')
{// _01, _02
// update is the last part _01, _01a, part 0 is the digits parts and 1 the trailing alpha
while (true)