Since we do ref counting on the nodes now, we can re-use the root nodes now

svn-id: r15851
This commit is contained in:
Max Horn 2004-11-21 13:18:07 +00:00
parent eb44281ecb
commit 01cb15b9b2
6 changed files with 40 additions and 31 deletions

View file

@ -197,11 +197,12 @@ const char *lastPathComponent(const Common::String &str) {
AbstractFilesystemNode *WindowsFilesystemNode::parent() const {
assert(_isValid || _isPseudoRoot);
WindowsFilesystemNode *p = new WindowsFilesystemNode();
WindowsFilesystemNode *p = 0;
if (!_isPseudoRoot && _path.size() > 3) {
const char *start = _path.c_str();
const char *end = lastPathComponent(_path);
p = new WindowsFilesystemNode();
p->_path = String(start, end - start);
p->_isValid = true;
p->_isDirectory = true;