[Scummvm-git-logs] scummvm master -> 0c09bba0f61d3a435112c517c9ff7b1054bdf07e
mistydemeo
noreply at scummvm.org
Mon Aug 8 20:06:21 UTC 2022
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:
0c09bba0f6 DIRECTOR: do not try to open dirs as files
Commit: 0c09bba0f61d3a435112c517c9ff7b1054bdf07e
https://github.com/scummvm/scummvm/commit/0c09bba0f61d3a435112c517c9ff7b1054bdf07e
Author: Misty De Meo (mistydemeo at gmail.com)
Date: 2022-08-08T13:06:16-07:00
Commit Message:
DIRECTOR: do not try to open dirs as files
Changed paths:
engines/director/util.cpp
diff --git a/engines/director/util.cpp b/engines/director/util.cpp
index 312331151c0..55126c28127 100644
--- a/engines/director/util.cpp
+++ b/engines/director/util.cpp
@@ -393,6 +393,7 @@ Common::String getPath(Common::String path, Common::String cwd) {
bool testPath(Common::String &path, bool directory) {
Common::FSNode d = Common::FSNode(*g_director->getGameDataDir());
+ Common::FSNode node;
// Test if we have it right in the SearchMan
if (SearchMan.hasFile(Common::Path(path, g_director->_dirSeparator)))
@@ -426,12 +427,18 @@ bool testPath(Common::String &path, bool directory) {
// for each element in the path, choose the first FSNode
// with a case-insensitive matcing name
if (i->getName().equalsIgnoreCase(token)) {
+ // If this is a directory, it's not a valid candidate
+ node = Common::FSNode(*i);
+ if (node.isDirectory()) {
+ continue;
+ }
+
exists = true;
newPath += i->getName();
if (!directory_list.empty())
newPath += (g_director->_dirSeparator);
- d = Common::FSNode(*i);
+ d = node;
break;
}
}
More information about the Scummvm-git-logs
mailing list