mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-04 09:18:38 +00:00
WINTERMUTE: Simplify getNodeForRelativePath
This commit is contained in:
parent
764ca7a51a
commit
71981aaecf
@ -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()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user