Library: fixed crash in Library::load if exename is NULL

This commit is contained in:
Daniel Marjamäki 2013-12-30 18:35:27 +01:00
parent 99703e1a3f
commit 8da0d84905
1 changed files with 2 additions and 0 deletions

View File

@ -76,6 +76,8 @@ bool Library::load(const char exename[], const char path[])
#ifdef CFGDIR
const std::string cfgfolder(CFGDIR);
#else
if (!exename)
return false;
const std::string cfgfolder(Path::fromNativeSeparators(Path::getPathFromFilename(exename)) + "cfg");
#endif
const char *sep = (!cfgfolder.empty() && cfgfolder[cfgfolder.size()-1U]=='/' ? "" : "/");