From f7aa9bc789ccaf6223e20a6fecd81ecd43b6740d Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 15 Mar 2022 12:17:30 +0100 Subject: tdf#149202 Allow for java.version consisting of four dotted segments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ...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:100: [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.) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131586 Tested-by: Jenkins Reviewed-by: Stephan Bergmann (cherry picked from commit 8e6462571bb4cb872f607b4ac9dfde7f43b79ac3) Change-Id: Id98235d3be59653ab412f9b6c1ffbf3b0470bd6f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134820 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx index 49157f033616..45ce0e1b8272 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx @@ -71,8 +71,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 @@ -112,10 +112,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) -- cgit