1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-10-05 22:02:38 +00:00

Fix ttvfs bugs, sync with dev repo

This commit is contained in:
fgenesis 2014-04-07 02:25:58 +02:00
commit b437a7cb2c
13 changed files with 84 additions and 108 deletions

View file

@ -42,6 +42,9 @@ void InternalDir::close()
void InternalDir::_addMountDir(CountedPtr<DirBase> d)
{
if(d.content() == this)
return;
// move to end of vector if already mounted
for(MountedDirs::iterator it = _mountedDirs.begin(); it != _mountedDirs.end(); ++it)
if(*it == d)
@ -162,7 +165,15 @@ bool InternalDir::_addToView(char *path, DirView& view)
return added;
}
File *InternalDir::getFileFromSubdir(const char *subdir, const char *file)
{
for(MountedDirs::reverse_iterator it = _mountedDirs.rbegin(); it != _mountedDirs.rend(); ++it)
if(File* f = (*it)->getFileFromSubdir(subdir, file))
return f;
InternalDir *d = safecast<InternalDir*>(DirBase::getDirByName(subdir, false, false)); // vcall not required here
return d ? d->getFile(file) : NULL;
}
VFS_NAMESPACE_END