AD: Properly set _maxScanDepth in case of automatic glob detection

This commit is contained in:
Eugene Sandulenko 2022-07-31 16:58:11 +02:00
parent a526eafb09
commit 950e3f459e
No known key found for this signature in database
GPG Key ID: 014D387312D34F08

View File

@ -847,6 +847,8 @@ void AdvancedMetaEngineDetection::preprocessDescriptions() {
Common::StringTokenizer tok(fileDesc->fileName, "/");
int depth = 0;
while (!tok.empty()) {
Common::String component = tok.nextToken();
@ -854,6 +856,14 @@ void AdvancedMetaEngineDetection::preprocessDescriptions() {
_globsMap.setVal(component, true);
debugC(4, kDebugGlobalDetection, " Added '%s' to globs", component.c_str());
}
depth++;
}
if (depth > _maxScanDepth) {
_maxScanDepth = depth;
debugC(4, kDebugGlobalDetection, " Increased scan depth to %d", _maxScanDepth);
}
}
}