From ecc6a2cac11bf62d8ff0be2662606eacccbd68c9 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 9 Mar 2016 23:37:47 +0100 Subject: SCUMM: Make DOTT/MM patch check less strict The original check broke if either DOTT or MM had a trailing path separator in the game path. The new check is too broad, but the risk of false positives should be minimal. The one in e11a370fe45aa96d240ff5f10e7263fdfc02bb01 would break if one of the two had a separator, but not both. --- engines/scumm/scumm.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 24d676a1ff..89d2d3dc72 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -2611,8 +2611,12 @@ bool ScummEngine::startManiac() { Common::String path = dom.getVal("path"); if (path.hasPrefix(currentPath)) { - path.erase(0, currentPath.size() + 1); - if (path.equalsIgnoreCase("maniac")) { + path.erase(0, currentPath.size()); + // Do a case-insensitive non-path-mode match of the remainder. + // While strictly speaking it's too broad, this matchString + // ignores the presence or absence of trailing path separators + // in either currentPath or path. + if (path.matchString("*maniac*", true, false)) { maniacTarget = iter->_key; break; } -- cgit v1.2.3