зеркало из https://github.com/mozilla/pjs.git
Fixes 38643. No longer do we eagerly resolve UNC paths on windows. r=gagan@netscape.com, sr=darin@netscape.com
This commit is contained in:
Родитель
6d3e58062c
Коммит
e70e59136f
|
@ -268,7 +268,9 @@ nsNoAuthURLParser::ParseAtDirectory(const char* i_Path, char* *o_Directory,
|
|||
CRTFREEIF(dirfile);
|
||||
dirfile = tempdir.ToNewCString();
|
||||
if (!dirfile) return NS_ERROR_OUT_OF_MEMORY;
|
||||
} else {
|
||||
}
|
||||
#if 0
|
||||
else {
|
||||
// if it is not beginning with a drive and
|
||||
// there are no three slashes then add them and
|
||||
// take it as an unc path
|
||||
|
@ -290,6 +292,7 @@ nsNoAuthURLParser::ParseAtDirectory(const char* i_Path, char* *o_Directory,
|
|||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
CoaleseDirs(dirfile);
|
||||
// Get length again
|
||||
dlen = PL_strlen(dirfile);
|
||||
|
|
|
@ -40,7 +40,8 @@
|
|||
#include "nsNetCID.h"
|
||||
|
||||
#if defined(XP_PC) && !defined(XP_OS2)
|
||||
#include <windows.h>
|
||||
#include <windows.h>
|
||||
#include <direct.h>
|
||||
#endif
|
||||
|
||||
static NS_DEFINE_CID(kThisStdURLImplementationCID,
|
||||
|
@ -1034,7 +1035,20 @@ nsStdURL::GetFile(nsIFile * *aFile)
|
|||
path.Insert(host, 0);
|
||||
}
|
||||
}
|
||||
path.ReplaceChar('/', '\\');
|
||||
|
||||
if ((path.CharAt(0) == '/' && path.CharAt(1) == '/')) {
|
||||
// unc path
|
||||
#ifdef DEBUG_dougt
|
||||
printf("+++ accessing UNC path\n");
|
||||
#endif
|
||||
}
|
||||
else if (path.CharAt(1) != ':') {
|
||||
char driveLetter = toupper( _getdrive() ) + 'A' - 1;
|
||||
path.Insert(driveLetter, 0);
|
||||
path.Insert(":\\", 1);
|
||||
}
|
||||
|
||||
path.ReplaceChar('/', '\\');
|
||||
#endif
|
||||
|
||||
nsUnescape((char*)path.get());
|
||||
|
|
Загрузка…
Ссылка в новой задаче