diff options
Diffstat (limited to 'backends/fs/fs.cpp')
-rw-r--r-- | backends/fs/fs.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/backends/fs/fs.cpp b/backends/fs/fs.cpp index f7844fb66a..12cdc145ba 100644 --- a/backends/fs/fs.cpp +++ b/backends/fs/fs.cpp @@ -99,17 +99,21 @@ FilesystemNode FilesystemNode::getChild(const String &name) const { return FilesystemNode(node); } -FSList FilesystemNode::listDir(ListMode mode) const { - assert(_realNode); - assert(_realNode->isDirectory()); - AbstractFSList inList(_realNode->listDir(mode)); - FSList outList; +bool FilesystemNode::listDir(FSList &fslist, ListMode mode) const { + if (!_realNode || !_realNode->isDirectory()) + return false; + + AbstractFSList tmp; + + if (!_realNode->listDir(tmp, mode)) + return false; - for (AbstractFSList::iterator i = inList.begin(); i != inList.end(); ++i) { - outList.push_back(FilesystemNode(*i)); + fslist.clear(); + for (AbstractFSList::iterator i = tmp.begin(); i != tmp.end(); ++i) { + fslist.push_back(FilesystemNode(*i)); } - return outList; + return true; } Common::String FilesystemNode::displayName() const { |