diff options
author | Andre Heider | 2009-01-18 12:58:06 +0000 |
---|---|---|
committer | Andre Heider | 2009-01-18 12:58:06 +0000 |
commit | 964a451e42568f014124c2899efbb81d9faee018 (patch) | |
tree | 9d352d8b672aab9d886ddae973e063ac282bf78f /backends/fs | |
parent | df6aa6361d2aa33f5c4536bc8f1007e434b88bc8 (diff) | |
download | scummvm-rg350-964a451e42568f014124c2899efbb81d9faee018.tar.gz scummvm-rg350-964a451e42568f014124c2899efbb81d9faee018.tar.bz2 scummvm-rg350-964a451e42568f014124c2899efbb81d9faee018.zip |
Removed slashes as last char from directories
svn-id: r35894
Diffstat (limited to 'backends/fs')
-rw-r--r-- | backends/fs/wii/wii-fs.cpp | 25 |
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)); } |