mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-02-18 02:34:57 +00:00
attempt to fix ttvfs crashes on osx
it's time to kick out the darn thing, but alas, not quite yet
This commit is contained in:
parent
6d70204847
commit
cd91ee51ef
2 changed files with 3 additions and 3 deletions
|
@ -172,7 +172,7 @@ void DirBase::forEachDir(DirEnumCallback f, void *user /* = NULL */, bool safe /
|
||||||
|
|
||||||
DirBase *DirBase::getDirByName(const char *dn, bool /* unused: lazyLoad = true */, bool useSubtrees /* = true */)
|
DirBase *DirBase::getDirByName(const char *dn, bool /* unused: lazyLoad = true */, bool useSubtrees /* = true */)
|
||||||
{
|
{
|
||||||
if(!dn[0] || (dn[0] == '.' && !dn[1]))
|
if(!dn || !dn[0] || (dn[0] == '.' && !dn[1]))
|
||||||
return this;
|
return this;
|
||||||
|
|
||||||
Dirs::iterator it = _subdirs.find(dn);
|
Dirs::iterator it = _subdirs.find(dn);
|
||||||
|
@ -312,7 +312,7 @@ DirBase *Dir::getDirByName(const char *dn, bool lazyLoad /* = true */, bool useS
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// Fix for absolute paths: No dir should have '/' (or any other absolute dirs) as subdir.
|
// Fix for absolute paths: No dir should have '/' (or any other absolute dirs) as subdir.
|
||||||
if(fullnameLen() && dn[0] == '/')
|
if(fullnameLen() && (dn && dn[0] == '/'))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// Lazy-load file if it's not in the tree yet
|
// Lazy-load file if it's not in the tree yet
|
||||||
|
|
|
@ -65,7 +65,7 @@ template <typename T> void SkipSelfPath(T *& s)
|
||||||
|
|
||||||
inline std::string joinPath(std::string base, const char *sub)
|
inline std::string joinPath(std::string base, const char *sub)
|
||||||
{
|
{
|
||||||
if(!*sub)
|
if(!sub || !*sub)
|
||||||
return base;
|
return base;
|
||||||
if(*sub != '/' && base.length() && base[base.length()-1] != '/')
|
if(*sub != '/' && base.length() && base[base.length()-1] != '/')
|
||||||
base += '/';
|
base += '/';
|
||||||
|
|
Loading…
Add table
Reference in a new issue