diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-07 14:16:40 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-07 15:12:35 +0200 |
commit | 21eb6c98bcfb1d453f8eb9f73bd87f6dd87aa882 (patch) | |
tree | a7181ac415821bfceba00da80beedc9ff3f553a9 /jvmfwk/plugins | |
parent | bac708dbd19940bfc7c211951bc7b198c9f0cdeb (diff) |
loplugin:flatten in jvmfwk
Change-Id: Ic58bc539ad6b4e1ef1d8049ec97547d1420be8a4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91817
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'jvmfwk/plugins')
-rw-r--r-- | jvmfwk/plugins/sunmajor/pluginlib/util.cxx | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx index ff540cc52325..db855d9ce4f4 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx @@ -1049,44 +1049,44 @@ void addJavaInfosFromPath( #if !defined JVM_ONE_PATH_CHECK // Get Java from PATH environment variable char *szPath= getenv("PATH"); - if(szPath) + if(!szPath) + return; + + OUString usAllPath(szPath, strlen(szPath), osl_getThreadTextEncoding()); + sal_Int32 nIndex = 0; + do { - OUString usAllPath(szPath, strlen(szPath), osl_getThreadTextEncoding()); - sal_Int32 nIndex = 0; - do + OUString usToken = usAllPath.getToken( 0, SAL_PATHSEPARATOR, nIndex ); + OUString usTokenUrl; + if(File::getFileURLFromSystemPath(usToken, usTokenUrl) == File::E_None) { - OUString usToken = usAllPath.getToken( 0, SAL_PATHSEPARATOR, nIndex ); - OUString usTokenUrl; - if(File::getFileURLFromSystemPath(usToken, usTokenUrl) == File::E_None) + if(!usTokenUrl.isEmpty()) { - if(!usTokenUrl.isEmpty()) + OUString usBin; + if(usTokenUrl == ".") { - OUString usBin; - if(usTokenUrl == ".") - { - OUString usWorkDirUrl; - if(osl_Process_E_None == osl_getProcessWorkingDir(&usWorkDirUrl.pData)) - usBin= usWorkDirUrl; - } - else if(usTokenUrl == "..") - { - OUString usWorkDir; - if(osl_Process_E_None == osl_getProcessWorkingDir(&usWorkDir.pData)) - usBin= getDirFromFile(usWorkDir); - } - else - { - usBin = usTokenUrl; - } - if(!usBin.isEmpty()) - { - addJREInfoFromBinPath(usBin, allInfos, addedInfos); - } + OUString usWorkDirUrl; + if(osl_Process_E_None == osl_getProcessWorkingDir(&usWorkDirUrl.pData)) + usBin= usWorkDirUrl; + } + else if(usTokenUrl == "..") + { + OUString usWorkDir; + if(osl_Process_E_None == osl_getProcessWorkingDir(&usWorkDir.pData)) + usBin= getDirFromFile(usWorkDir); + } + else + { + usBin = usTokenUrl; + } + if(!usBin.isEmpty()) + { + addJREInfoFromBinPath(usBin, allInfos, addedInfos); } } } - while ( nIndex >= 0 ); } + while ( nIndex >= 0 ); #endif } |