mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 10:00:54 +00:00
Fixing 49866. Could cause a crash on opt builds that did not set the env HOME. r=adamlock@netscape.com
This commit is contained in:
parent
3a78e35001
commit
90b2424793
@ -585,7 +585,7 @@ void nsSpecialSystemDirectory::operator = (SystemDirectories aSystemSystemDirect
|
|||||||
case Win_HomeDirectory:
|
case Win_HomeDirectory:
|
||||||
{
|
{
|
||||||
char path[_MAX_PATH];
|
char path[_MAX_PATH];
|
||||||
if (GetEnvironmentVariable(TEXT("HOME"), path, _MAX_PATH) >= 0)
|
if (GetEnvironmentVariable(TEXT("HOME"), path, _MAX_PATH) > 0)
|
||||||
{
|
{
|
||||||
PRInt32 len = PL_strlen(path);
|
PRInt32 len = PL_strlen(path);
|
||||||
// Need enough space to add the trailing backslash
|
// Need enough space to add the trailing backslash
|
||||||
@ -599,12 +599,12 @@ void nsSpecialSystemDirectory::operator = (SystemDirectories aSystemSystemDirect
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetEnvironmentVariable(TEXT("HOMEDRIVE"), path, _MAX_PATH) >= 0)
|
if (GetEnvironmentVariable(TEXT("HOMEDRIVE"), path, _MAX_PATH) > 0)
|
||||||
{
|
{
|
||||||
char temp[_MAX_PATH];
|
char temp[_MAX_PATH];
|
||||||
if (GetEnvironmentVariable(TEXT("HOMEPATH"), temp, _MAX_PATH) > 0)
|
if (GetEnvironmentVariable(TEXT("HOMEPATH"), temp, _MAX_PATH) > 0)
|
||||||
PL_strcatn(path, _MAX_PATH, temp);
|
PL_strcatn(path, _MAX_PATH, temp);
|
||||||
|
|
||||||
PRInt32 len = PL_strlen(path);
|
PRInt32 len = PL_strlen(path);
|
||||||
|
|
||||||
// Need enough space to add the trailing backslash
|
// Need enough space to add the trailing backslash
|
||||||
|
Loading…
Reference in New Issue
Block a user