aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/glulxe
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/glulxe
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/glulxe')
-rw-r--r--engines/glk/glulxe/detection.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/engines/glk/glulxe/detection.cpp b/engines/glk/glulxe/detection.cpp
index 64c6eabb5a..d75f1b73ec 100644
--- a/engines/glk/glulxe/detection.cpp
+++ b/engines/glk/glulxe/detection.cpp
@@ -55,9 +55,11 @@ bool GlulxeMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &
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
Common::File gameFile;
@@ -69,7 +71,7 @@ bool GlulxeMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &
isBlorb = Blorb::isBlorb(gameFile, ID_GLUL);
gameFile.close();
- if (!hasExt && !isBlorb)
+ if (!isBlorb && Blorb::hasBlorbExt(filename))
continue;
// Check for known games