mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Bug 301043 - SeaMonkey application quits immediately after launch (installer with GRE only), r=darin, self-approved (seamonkey only)
This commit is contained in:
parent
39e056ccb5
commit
151a6eac74
@ -51,7 +51,7 @@
|
||||
#ifdef XP_WIN
|
||||
#include <windows.h>
|
||||
#include <mbstring.h>
|
||||
|
||||
#include <malloc.h>
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
|
||||
@ -467,6 +467,27 @@ nsresult GRE_Startup()
|
||||
return rv;
|
||||
}
|
||||
|
||||
#ifdef XP_WIN
|
||||
// On windows we have legacy GRE code that does not load the GRE dependent
|
||||
// libs (seamonkey GRE, not libxul)... add the GRE to the PATH.
|
||||
// See bug 301043.
|
||||
|
||||
char *lastSlash = strrchr(xpcomLocation, '\\');
|
||||
if (lastSlash) {
|
||||
int xpcomPathLen = lastSlash - xpcomLocation;
|
||||
DWORD pathLen = GetEnvironmentVariable("PATH", nsnull, 0);
|
||||
|
||||
char *newPath = (char*) _alloca(xpcomPathLen + pathLen + 1);
|
||||
strncpy(newPath, xpcomLocation, xpcomPathLen);
|
||||
// in case GetEnvironmentVariable fails
|
||||
newPath[xpcomPathLen] = ';';
|
||||
newPath[xpcomPathLen + 1] = '\0';
|
||||
|
||||
GetEnvironmentVariable("PATH", newPath + xpcomPathLen + 1, pathLen);
|
||||
SetEnvironmentVariable("PATH", newPath);
|
||||
}
|
||||
#endif
|
||||
|
||||
nsGREDirServiceProvider *provider = new nsGREDirServiceProvider();
|
||||
if ( !provider ) {
|
||||
NS_WARNING("GRE_Startup failed");
|
||||
|
Loading…
Reference in New Issue
Block a user