aboutsummaryrefslogtreecommitdiff
path: root/backends/fs/windows
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/windows
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/windows')
-rw-r--r--backends/fs/windows/windows-fs.cpp13
1 files changed, 2 insertions, 11 deletions
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()));