Library: Make loading of cfg files more robust. Saw a problem to use --library=gtk when the current folder has a folder 'gtk'

This commit is contained in:
Daniel Marjamäki 2018-12-24 08:37:33 +01:00
parent 7875555b03
commit b3e6ecd827
1 changed files with 3 additions and 0 deletions

View File

@ -81,6 +81,9 @@ Library::Error Library::load(const char exename[], const char path[])
// open file..
tinyxml2::XMLDocument doc;
tinyxml2::XMLError error = doc.LoadFile(path);
if (error == tinyxml2::XML_ERROR_FILE_READ_ERROR && Path::getFilenameExtension(path).empty())
// Reading file failed, try again...
error = tinyxml2::XML_ERROR_FILE_NOT_FOUND;
if (error == tinyxml2::XML_ERROR_FILE_NOT_FOUND) {
// failed to open file.. is there no extension?
std::string fullfilename(path);