aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/base/file/base_disk_file.cpp
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-08-31 16:34:12 +0200
committerEinar Johan Trøan Sømåen2012-08-31 16:34:12 +0200
commit71981aaecf68b6a0910a18cad67cbba9ac7a1fb1 (patch)
treee6c782611d005efa52bf34903dd3953ee36e0b3c /engines/wintermute/base/file/base_disk_file.cpp
parent764ca7a51a27210ca7a66a6ab2f01714029af09c (diff)
downloadscummvm-rg350-71981aaecf68b6a0910a18cad67cbba9ac7a1fb1.tar.gz
scummvm-rg350-71981aaecf68b6a0910a18cad67cbba9ac7a1fb1.tar.bz2
scummvm-rg350-71981aaecf68b6a0910a18cad67cbba9ac7a1fb1.zip
WINTERMUTE: Simplify getNodeForRelativePath
Diffstat (limited to 'engines/wintermute/base/file/base_disk_file.cpp')
-rw-r--r--engines/wintermute/base/file/base_disk_file.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/engines/wintermute/base/file/base_disk_file.cpp b/engines/wintermute/base/file/base_disk_file.cpp
index 2f7450a999..44a8049121 100644
--- a/engines/wintermute/base/file/base_disk_file.cpp
+++ b/engines/wintermute/base/file/base_disk_file.cpp
@@ -71,14 +71,11 @@ static Common::FSNode getNodeForRelativePath(const Common::String &filename) {
// Get the next path-component by slicing on '\\'
Common::String pathPart = path.nextToken();
// Get the next FSNode in the chain, if it exists as a child from the previous.
- Common::FSNode nextNode(curNode.getChild(pathPart));
- if (!nextNode.exists()) {
+ curNode = curNode.getChild(pathPart);
+ if (!curNode.isReadable()) {
// Return an invalid FSNode.
return Common::FSNode();
}
- if (nextNode.exists() && nextNode.isReadable()) {
- curNode = nextNode;
- }
// Following the comments in common/fs.h, anything not a directory is a file.
if (!curNode.isDirectory()) {
if (!path.empty()) {