mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-18 23:57:32 +00:00
Trim resource filenames to 8 characters as a last resort on BRA. Script files are unbelievably broken.
svn-id: r35784
This commit is contained in:
parent
294c76f4c4
commit
beacae5efd
@ -102,8 +102,26 @@ Common::SeekableReadStream *Disk_br::openFile_internal(bool errorOnNotFound, con
|
|||||||
}
|
}
|
||||||
|
|
||||||
Common::SeekableReadStream *stream = _sset.openFile(lookup);
|
Common::SeekableReadStream *stream = _sset.openFile(lookup);
|
||||||
|
if (stream) {
|
||||||
|
return stream;
|
||||||
|
}
|
||||||
|
|
||||||
|
// as a very last resort, try trimming the file name to 8 chars
|
||||||
|
if (!ext.empty() && lookup.hasSuffix(ext.c_str())) {
|
||||||
|
Common::String filename = Common::lastPathComponent(lookup, '/');
|
||||||
|
int len = filename.size();
|
||||||
|
if (len > 8) {
|
||||||
|
debugC(9, kDebugDisk, "Disk_br::openFile: trimming filename (%s) to 8 characters", name.c_str());
|
||||||
|
while (len-- > 8) {
|
||||||
|
lookup.deleteLastChar();
|
||||||
|
}
|
||||||
|
lookup += ext;
|
||||||
|
stream = _sset.openFile(lookup);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!stream && errorOnNotFound) {
|
if (!stream && errorOnNotFound) {
|
||||||
errorFileNotFound(lookup);
|
errorFileNotFound(name);
|
||||||
}
|
}
|
||||||
return stream;
|
return stream;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user