COMMON: Do not try to read from res forks of non-existant files

This commit is contained in:
Max Horn 2011-06-10 22:30:03 +02:00
parent eea6f69b59
commit 7ab553d72a

View file

@ -107,14 +107,17 @@ bool MacResManager::open(String filename) {
#ifdef MACOSX
// Check the actual fork on a Mac computer
String fullPath = ConfMan.get("path") + "/" + filename + "/..namedfork/rsrc";
SeekableReadStream *macResForkRawStream = FSNode(fullPath).createReadStream();;
FSNode resFsNode = FSNode(fullPath);
if (resFsNode.exists()) {
SeekableReadStream *macResForkRawStream = resFsNode.createReadStream();;
if (macResForkRawStream && loadFromRawFork(*macResForkRawStream)) {
_baseFileName = filename;
return true;
if (macResForkRawStream && loadFromRawFork(*macResForkRawStream)) {
_baseFileName = filename;
return true;
}
delete macResForkRawStream;
}
delete macResForkRawStream;
#endif
File *file = new File();
@ -167,14 +170,17 @@ bool MacResManager::open(FSNode path, String filename) {
#ifdef MACOSX
// Check the actual fork on a Mac computer
String fullPath = path.getPath() + "/" + filename + "/..namedfork/rsrc";
SeekableReadStream *macResForkRawStream = FSNode(fullPath).createReadStream();
FSNode resFsNode = FSNode(fullPath);
if (resFsNode.exists()) {
SeekableReadStream *macResForkRawStream = resFsNode.createReadStream();;
if (macResForkRawStream && loadFromRawFork(*macResForkRawStream)) {
_baseFileName = filename;
return true;
if (macResForkRawStream && loadFromRawFork(*macResForkRawStream)) {
_baseFileName = filename;
return true;
}
delete macResForkRawStream;
}
delete macResForkRawStream;
#endif
// First, let's try to see if the Mac converted name exists