On Wed, 31 Mar 2021 19:30:10 GMT, Andy Herrick <[email protected]> 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