mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 11:55:49 +00:00
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:
parent
ce46b37fea
commit
27394cb877
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user