mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 20:35:50 +00:00
Sets the current directory to the process directory at startup. This is to avoid a potential problem with embedding applications calling ShellExecute where the working directory parameter. This results in the new process inheriting the current working directory of the old process. See bug 202363. r=wtc@netscape.com, a=asa@mozilla.org
This commit is contained in:
parent
44d9f9a8fb
commit
04fb8b72d8
@ -487,6 +487,21 @@ nsGREDirServiceProvider::AddGRELocationToPath()
|
||||
XPCOM_SEARCH_KEY,
|
||||
grePath,
|
||||
path);
|
||||
|
||||
#if XP_WIN32
|
||||
// On windows, the current directory is searched before the
|
||||
// PATH environment variable. This is a very bad thing
|
||||
// since libraries in the cwd will be picked up before
|
||||
// any that are in either the application or GRE directory.
|
||||
|
||||
char* cpd = GetGREDirectoryPath();
|
||||
if (cpd) {
|
||||
SetCurrentDirectory(cpd);
|
||||
free (cpd);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
PR_SetEnv(mPathEnvString);
|
||||
free(grePath);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user