[Scummvm-git-logs] scummvm master -> 33add84c46f9b7c5e33508195a0f01af220235eb
eriktorbjorn
eriktorbjorn at telia.com
Sun Jul 25 07:48:51 UTC 2021
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
33add84c46 ZVISION: Fix crash when using --auto-detect (#12743)
Commit: 33add84c46f9b7c5e33508195a0f01af220235eb
https://github.com/scummvm/scummvm/commit/33add84c46f9b7c5e33508195a0f01af220235eb
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2021-07-25T09:48:30+02:00
Commit Message:
ZVISION: Fix crash when using --auto-detect (#12743)
It would try to look outside the (empty) string, checking for directory
separators to remove. Now it gets the root path from the FSNode after
creating it, in case it's no longer the same as the one provided.
Changed paths:
engines/zvision/file/search_manager.cpp
diff --git a/engines/zvision/file/search_manager.cpp b/engines/zvision/file/search_manager.cpp
index 072393945d..ef3b9be341 100644
--- a/engines/zvision/file/search_manager.cpp
+++ b/engines/zvision/file/search_manager.cpp
@@ -30,11 +30,15 @@
namespace ZVision {
SearchManager::SearchManager(const Common::String &rootPath, int depth) {
- _root = rootPath;
- if (_root[_root.size() - 1] == '\\' || _root[_root.size() - 1] == '/')
- _root.deleteLastChar();
+ Common::FSNode fsNode(rootPath);
+
+ // Retrieve the root path from the FSNode, since it may not be the
+ // same as rootPath any more, e.g. if we're doing auto-detection on
+ // the current directory.
- Common::FSNode fsNode(_root);
+ _root = fsNode.getPath();
+ if (_root.hasSuffix("\\") || _root.hasSuffix("/"))
+ _root.deleteLastChar();
listDirRecursive(_dirList, fsNode, depth);
More information about the Scummvm-git-logs
mailing list