jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 8e6462571bb4cb872f607b4ac9dfde7f43b79ac3
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Tue Mar 15 12:17:30 2022 +0100
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Tue Mar 15 13:46:06 2022 +0100

    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: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.)
    
    Change-Id: Id98235d3be59653ab412f9b6c1ffbf3b0470bd6f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131586
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
index 490d5febbea4..16a1e14f3662 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
@@ -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)

Reply via email to