From 280a4f2d911d10f8199a88805fae6966ac00f44b Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Sun, 31 Mar 2019 19:46:16 +0100 Subject: GLK: Only check the format of a Blorb file if it has a valid file extension --- engines/glk/scott/detection.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'engines/glk/scott') diff --git a/engines/glk/scott/detection.cpp b/engines/glk/scott/detection.cpp index 0e89b13f86..e2c98723c4 100644 --- a/engines/glk/scott/detection.cpp +++ b/engines/glk/scott/detection.cpp @@ -54,9 +54,11 @@ bool ScottMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &g 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; Common::File gameFile; if (!gameFile.open(*file)) @@ -67,7 +69,7 @@ bool ScottMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &g isBlorb = Blorb::isBlorb(gameFile, ID_SAAI); gameFile.close(); - if (!hasExt && !isBlorb) + if (!isBlorb && Blorb::hasBlorbExt(filename)) continue; // Scan through the Scott game list for a match -- cgit v1.2.3