From d3f9e9a69dd59d6b37fd0580d610483aaa47759d Mon Sep 17 00:00:00 2001 From: "waterson%netscape.com" Date: Wed, 8 Mar 2000 02:53:04 +0000 Subject: [PATCH] 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 --- mozilla/xpcom/io/nsLocalFileWin.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/mozilla/xpcom/io/nsLocalFileWin.cpp b/mozilla/xpcom/io/nsLocalFileWin.cpp index 4e8f71696fa..813018ed73d 100644 --- a/mozilla/xpcom/io/nsLocalFileWin.cpp +++ b/mozilla/xpcom/io/nsLocalFileWin.cpp @@ -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);