aboutsummaryrefslogtreecommitdiff
path: root/backends/fs
diff options
context:
space:
mode:
authorMax Horn2006-04-04 21:03:17 +0000
committerMax Horn2006-04-04 21:03:17 +0000
commitac9203415e263f92ea8043eed2301375b806262e (patch)
tree3d4606221c9811a980c8b6393f39c80cba3a9a09 /backends/fs
parentca6d34522039aa7d8aa8da1d8f4c30f4ad9aecc4 (diff)
downloadscummvm-rg350-ac9203415e263f92ea8043eed2301375b806262e.tar.gz
scummvm-rg350-ac9203415e263f92ea8043eed2301375b806262e.tar.bz2
scummvm-rg350-ac9203415e263f92ea8043eed2301375b806262e.zip
Some more FS code cleanup
svn-id: r21600
Diffstat (limited to 'backends/fs')
-rw-r--r--backends/fs/palmos/palmos-fs.cpp2
-rw-r--r--backends/fs/posix/posix-fs.cpp2
-rw-r--r--backends/fs/windows/windows-fs.cpp13
3 files changed, 4 insertions, 13 deletions
diff --git a/backends/fs/palmos/palmos-fs.cpp b/backends/fs/palmos/palmos-fs.cpp
index 301226685d..02e33e0fa9 100644
--- a/backends/fs/palmos/palmos-fs.cpp
+++ b/backends/fs/palmos/palmos-fs.cpp
@@ -62,7 +62,7 @@ static const char *lastPathComponent(const Common::String &str) {
--cur;
}
- return cur+1;
+ return cur + 1;
}
void PalmOSFilesystemNode::addFile(FSList &list, ListMode mode, const char *base, FileInfoType* find_data) {
diff --git a/backends/fs/posix/posix-fs.cpp b/backends/fs/posix/posix-fs.cpp
index f32f30d8ba..8f66e4aa76 100644
--- a/backends/fs/posix/posix-fs.cpp
+++ b/backends/fs/posix/posix-fs.cpp
@@ -69,7 +69,7 @@ static const char *lastPathComponent(const Common::String &str) {
--cur;
}
- return cur+1;
+ return cur + 1;
}
AbstractFilesystemNode *FilesystemNode::getRoot() {
diff --git a/backends/fs/windows/windows-fs.cpp b/backends/fs/windows/windows-fs.cpp
index 5b220427d2..556d839496 100644
--- a/backends/fs/windows/windows-fs.cpp
+++ b/backends/fs/windows/windows-fs.cpp
@@ -145,19 +145,10 @@ WindowsFilesystemNode::WindowsFilesystemNode() {
WindowsFilesystemNode::WindowsFilesystemNode(const String &p) {
int len = 0, offset = p.size();
- assert(offset > 0);
+ assert(p.size() > 0);
_path = p;
-
- // Extract last component from path
- const char *str = p.c_str();
- while (offset > 0 && str[offset-1] == '\\')
- offset--;
- while (offset > 0 && str[offset-1] != '\\') {
- len++;
- offset--;
- }
- _displayName = String(str + offset, len);
+ _displayName = lastPathComponent(_path);
// Check whether it is a directory, and whether the file actually exists
DWORD fileAttribs = GetFileAttributes(toUnicode(_path.c_str()));