Temp hack for the Mac to address error opening files that aren't properly un-escaped (%20 still in the path instead of spaces for example). We still fail to open the file but now there's an error message to go along with the failure. Note that this will require Macsbug to be installed or a Mac hitting this error will crash. Since we were already telling people that they needed Macsbug installed to run the developmental builds I don't see a problem with this.

This commit is contained in:
sdagley%netscape.com 1999-07-30 00:37:58 +00:00
Родитель 0758bdd7aa
Коммит 55649b036c
1 изменённых файлов: 17 добавлений и 0 удалений

Просмотреть файл

@ -107,6 +107,23 @@ nsFileChannel::Init(nsFileProtocolHandler* handler,
} else {
nsFilePath filePath(fileString);
mSpec = filePath;
// Don't assume we actually created a good file spec
FSSpec theSpec = mSpec.GetFSSpec();
if (!theSpec.name[0])
{
NS_ERROR("failed to create a file spec");
// Some temp debugstr hackery so optimized builds display an error message
// !!!!!REMOVE THIS ONCE WE GET THE FILE NAME UN-ESCAPING CODE IN
DebugStr("\p\rFailed to create a file spec for the specified file.\r"\
"This is usually due to having a space somewhere in the path\r"\
"to the application (say if your hard drive is named Macintosh HD\r"\
"or you're trying to run from the Desktop Folder). We'll fix this soon.");
// Since we didn't actually create the file spec we return an error
return NS_ERROR_MALFORMED_URI;
}
}
#else
nsFilePath filePath(fileString);