Bug 29250. PR_GetFileInfo64() expects a 'root' path on Win32 to have a trailing slash; e.g., it will accept 'c:\\', but not 'c:'. Ensure that, if we ever see a naked drive letter, we'll append a trailing backslash to make something that NSPR understands. r=dveditz, a=jevering

git-svn-id: svn://10.0.0.236/trunk@62370 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
waterson%netscape.com
2000-03-08 02:53:04 +00:00
parent adb1452d9d
commit d3f9e9a69d

View File

@@ -506,11 +506,20 @@ nsLocalFile::ResolveAndStat(PRBool resolveTerminal)
// can simply use that as the resolved path. This simplification can
// be done on windows cause its symlinks (shortcuts) use the .lnk
// file extension.
const char *workingFilePath = mWorkingPath.GetBuffer();
PRStatus status = PR_GetFileInfo64(workingFilePath, &mFileInfo64);
char temp[4];
const char* workingFilePath = mWorkingPath.GetBuffer();
const char* nsprPath = workingFilePath;
if (mWorkingPath.Length() == 2 && mWorkingPath.CharAt(1) == ':') {
temp[0] = workingFilePath[0];
temp[1] = workingFilePath[1];
temp[2] = '\\';
temp[3] = '\0';
nsprPath = temp;
}
PRStatus status = PR_GetFileInfo64(nsprPath, &mFileInfo64);
if ( status == PR_SUCCESS )
{
mResolvedPath.SetString(workingFilePath);