mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-12 12:09:15 +00:00
Some more FS code cleanup
svn-id: r21600
This commit is contained in:
parent
ca6d345220
commit
ac9203415e
@ -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) {
|
||||
|
@ -69,7 +69,7 @@ static const char *lastPathComponent(const Common::String &str) {
|
||||
--cur;
|
||||
}
|
||||
|
||||
return cur+1;
|
||||
return cur + 1;
|
||||
}
|
||||
|
||||
AbstractFilesystemNode *FilesystemNode::getRoot() {
|
||||
|
@ -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()));
|
||||
|
Loading…
Reference in New Issue
Block a user