diff options
author | Sravan Kumar Lakkimsetti | 2021-08-27 13:44:29 +0000 |
---|---|---|
committer | Sravan Kumar Lakkimsetti | 2021-08-28 07:57:34 +0000 |
commit | 585d63b8c7344a743125a7e0c916d59475aeda49 (patch) | |
tree | d4b5f7eb17f8d91a5b7d7bf7cf721e0fab7584c5 | |
parent | d231f4aaf90c9fcee6069ced7e5cf836a0f4183c (diff) | |
download | rt.equinox.framework-585d63b8c7344a743125a7e0c916d59475aeda49.tar.gz rt.equinox.framework-585d63b8c7344a743125a7e0c916d59475aeda49.tar.xz rt.equinox.framework-585d63b8c7344a743125a7e0c916d59475aeda49.zip |
Bug 575665 - [Macos] Eclipse launcher crashes if -showsplash points to
plugin
Change-Id: I0328803b0268bc32902a328eac59aeef89656db2
Signed-off-by: Sravan Kumar Lakkimsetti <sravankumarl@in.ibm.com>
Reviewed-on: https://git.eclipse.org/r/c/equinox/rt.equinox.framework/+/184536
-rw-r--r-- | features/org.eclipse.equinox.executable.feature/library/eclipse.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/features/org.eclipse.equinox.executable.feature/library/eclipse.c b/features/org.eclipse.equinox.executable.feature/library/eclipse.c index 79356d3da..f2aab5b76 100644 --- a/features/org.eclipse.equinox.executable.feature/library/eclipse.c +++ b/features/org.eclipse.equinox.executable.feature/library/eclipse.c @@ -1442,8 +1442,13 @@ static _TCHAR* findSplash(_TCHAR* splashArg) { prefix = ch + 1; } else { /* No separator, treat splashArg as the prefix and look in the plugins dir */ +#ifdef MACOSX + path = malloc( (_tcslen(programDir) + 20) * sizeof(_TCHAR)); + _stprintf(path, _T_ECLIPSE("%s%c%s%s"), programDir, dirSeparator, _T_ECLIPSE("../Eclipse/"), _T_ECLIPSE("plugins")); +#else path = malloc( (_tcslen(programDir) + 9) * sizeof(_TCHAR)); _stprintf(path, _T_ECLIPSE("%s%c%s"), programDir, dirSeparator, _T_ECLIPSE("plugins")); +#endif prefix = splashArg; } dir = findFile(path, prefix); @@ -1453,17 +1458,19 @@ static _TCHAR* findSplash(_TCHAR* splashArg) { } /* directory, look for splash image */ - length = _tcslen(dir); - for (name = SPLASH_IMAGES; *name; name += _tcslen(name) + 1) { - ch = malloc((length + 1 + _tcslen(name) + 1) * sizeof(_TCHAR)); - _stprintf(ch, _T_ECLIPSE("%s%c%s"), dir, dirSeparator, name); - if (_tstat(ch, &stats) == 0 && (stats.st_mode & S_IFREG)) { - free(dir); - return ch; + if (dir != NULL) { + length = _tcslen(dir); + for (name = SPLASH_IMAGES; *name; name += _tcslen(name) + 1) { + ch = malloc((length + 1 + _tcslen(name) + 1) * sizeof(_TCHAR)); + _stprintf(ch, _T_ECLIPSE("%s%c%s"), dir, dirSeparator, name); + if (_tstat(ch, &stats) == 0 && (stats.st_mode & S_IFREG)) { + free(dir); + return ch; + } + free(ch); } - free(ch); + free(dir); } - free(dir); return NULL; } |