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

This commit is contained in:
waterson%netscape.com 2000-03-08 02:53:04 +00:00
parent ce46b37fea
commit 27394cb877

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);