aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Heider2009-01-18 12:58:06 +0000
committerAndre Heider2009-01-18 12:58:06 +0000
commit964a451e42568f014124c2899efbb81d9faee018 (patch)
tree9d352d8b672aab9d886ddae973e063ac282bf78f
parentdf6aa6361d2aa33f5c4536bc8f1007e434b88bc8 (diff)
downloadscummvm-rg350-964a451e42568f014124c2899efbb81d9faee018.tar.gz
scummvm-rg350-964a451e42568f014124c2899efbb81d9faee018.tar.bz2
scummvm-rg350-964a451e42568f014124c2899efbb81d9faee018.zip
Removed slashes as last char from directories
svn-id: r35894
-rw-r--r--backends/fs/wii/wii-fs.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/backends/fs/wii/wii-fs.cpp b/backends/fs/wii/wii-fs.cpp
index d579d9f2a3..7c42eb6e4a 100644
--- a/backends/fs/wii/wii-fs.cpp
+++ b/backends/fs/wii/wii-fs.cpp
@@ -134,12 +134,13 @@ WiiFilesystemNode::WiiFilesystemNode(const Common::String &p) {
return;
}
- _path = p;
+ _path = Common::normalizePath(p, '/');
- if (_path.hasSuffix(":/"))
- _displayName = _path;
- else
- _displayName = lastPathComponent(_path, '/');
+ // "fat:" is not a valid directory, but "fat:/" is
+ if (_path.lastChar() == ':')
+ _path += '/';
+
+ _displayName = lastPathComponent(_path, '/');
struct stat st;
if (!stat(_path.c_str(), &st))
@@ -154,12 +155,13 @@ WiiFilesystemNode::WiiFilesystemNode(const Common::String &p, const struct stat
return;
}
- _path = p;
+ _path = Common::normalizePath(p, '/');
- if (_path.hasSuffix(":/"))
- _displayName = _path;
- else
- _displayName = lastPathComponent(_path, '/');
+ // "fat:" is not a valid directory, but "fat:/" is
+ if (_path.lastChar() == ':')
+ _path += '/';
+
+ _displayName = lastPathComponent(_path, '/');
setFlags(st);
}
@@ -210,9 +212,6 @@ bool WiiFilesystemNode::getChildren(AbstractFSList &list, ListMode mode, bool hi
(mode == Common::FSNode::kListDirectoriesOnly && !isDir))
continue;
- if (isDir)
- newPath += '/';
-
list.push_back(new WiiFilesystemNode(newPath, &st));
}