aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/frotz
diff options
context:
space:
mode:
authorCameron Cawley2019-03-31 19:46:16 +0100
committerPaul Gilbert2019-03-31 16:37:47 -0700
commit280a4f2d911d10f8199a88805fae6966ac00f44b (patch)
treeb3d84b0f23517c5c47700d944c4d49afff30a3ea /engines/glk/frotz
parent7b4c6d6a35f00e46d9021b236393a40aa54e6a6e (diff)
downloadscummvm-rg350-280a4f2d911d10f8199a88805fae6966ac00f44b.tar.gz
scummvm-rg350-280a4f2d911d10f8199a88805fae6966ac00f44b.tar.bz2
scummvm-rg350-280a4f2d911d10f8199a88805fae6966ac00f44b.zip
GLK: Only check the format of a Blorb file if it has a valid file extension
Diffstat (limited to 'engines/glk/frotz')
-rw-r--r--engines/glk/frotz/detection.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/engines/glk/frotz/detection.cpp b/engines/glk/frotz/detection.cpp
index 4df4fd2be8..b9d5e1062b 100644
--- a/engines/glk/frotz/detection.cpp
+++ b/engines/glk/frotz/detection.cpp
@@ -65,9 +65,11 @@ bool FrotzMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &g
if (file->isDirectory())
continue;
Common::String filename = file->getName();
- bool hasExt = false, isBlorb = false;
+ bool hasExt = Blorb::hasBlorbExt(filename), isBlorb = false;
for (const char *const *ext = &EXTENSIONS[0]; *ext && !hasExt; ++ext)
hasExt = filename.hasSuffixIgnoreCase(*ext);
+ if (!hasExt)
+ continue;
// Open up the file and calculate the md5, and get the serial
Common::File gameFile;
@@ -81,7 +83,7 @@ bool FrotzMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &g
isBlorb = Blorb::isBlorb(gameFile, ID_ZCOD);
if (!isBlorb) {
- if (!hasExt) {
+ if (Blorb::hasBlorbExt(filename)) {
gameFile.close();
continue;
}