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/frotz/detection.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'engines/glk/frotz') 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; } -- cgit v1.2.3