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:
dougt%netscape.com 2000-08-28 22:14:02 +00:00
parent 3a78e35001
commit 90b2424793

View File

@ -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