зеркало из https://github.com/mozilla/pjs.git
Fixing 38767. Allows C: to be a valid path to InitWithPath();
This commit is contained in:
Родитель
e56e2ccb26
Коммит
0a752c90da
|
@ -591,8 +591,17 @@ nsLocalFile::InitWithPath(const char *filePath)
|
|||
|
||||
// just do a sanity check. if it has any forward slashes, it is not a Native path
|
||||
// on windows. Also, it must have a colon at after the first char.
|
||||
if (filePath[0] == 0)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
if ( (filePath[2] == 0) && (filePath[1] == ':') )
|
||||
{
|
||||
nativeFilePath = (char*) nsAllocator::Clone( filePath, 4 );
|
||||
// C : //
|
||||
nativeFilePath[2] = '\\';
|
||||
}
|
||||
|
||||
if ( ( (filePath[0] != 0) && (filePath[1] == ':') && (strchr(filePath, '/') == 0) ) || // normal windows path
|
||||
if ( ( (filePath[1] == ':') && (strchr(filePath, '/') == 0) ) || // normal windows path
|
||||
( (filePath[0] == '\\') && (filePath[1] == '\\') ) ) // netwerk path
|
||||
{
|
||||
// This is a native path
|
||||
|
|
Загрузка…
Ссылка в новой задаче