Some more FS code cleanup

svn-id: r21600
This commit is contained in:
Max Horn 2006-04-04 21:03:17 +00:00
parent ca6d345220
commit ac9203415e
3 changed files with 4 additions and 13 deletions

View File

@ -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) {

View File

@ -69,7 +69,7 @@ static const char *lastPathComponent(const Common::String &str) {
--cur;
}
return cur+1;
return cur + 1;
}
AbstractFilesystemNode *FilesystemNode::getRoot() {

View File

@ -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()));