RFR: JDK-8264403: [macos]: App names containing '.' characters results in an error message when launching

Alexey Semenyuk asemenyuk at openjdk.java.net
Wed Mar 31 22:03:32 UTC 2021


On Wed, 31 Mar 2021 19:30:10 GMT, Andy Herrick <herrick at openjdk.org> wrote:

> Deriving the cfg file name is broken on mac and linux when the application name has a "." in it.

Changes requested by asemenyuk (Reviewer).

src/jdk.jpackage/share/native/common/FileUtils.h line 76:

> 74: 
> 75:     // extract the name from the launcher path
> 76:     tstring extractName(const tstring& path);

Function name seems to be misleading. 
If it specifically designed to be applied to executables, I'd name it `stripExecutableSuffix()`. On Unix implementation would return passed in string as is without calling `basename()` and on Windows would just strip ".exe" suffix not calling `basename()` either.
The use would be: `FileUtils::mkpath() << appDirPath << (FileUtils::stripExecutableSuffix(FileUtils::basename(launcherPath)) + _T(".cfg"));`

-------------

PR: https://git.openjdk.java.net/jdk/pull/3288


More information about the core-libs-dev mailing list