diff options
Diffstat (limited to 'backends/fs/windows')
-rw-r--r-- | backends/fs/windows/windows-fs.cpp | 13 |
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())); |