mirror of
https://github.com/glest/glest-source.git
synced 2025-02-25 04:02:30 +01:00
- see if this fixes loading issue on windows
This commit is contained in:
parent
5473372e4b
commit
864ef8acec
@ -181,6 +181,11 @@ Config::Config(std::pair<ConfigType,ConfigType> type, std::pair<string,string> f
|
||||
//string currentpath = extractDirectoryPathFromFile(Properties::getApplicationPath());
|
||||
fileName.first = currentpath + fileName.first;
|
||||
}
|
||||
|
||||
#if defined(WIN32)
|
||||
updatePathClimbingParts(fileName.first);
|
||||
#endif
|
||||
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("-=-=-=-=-=-=-= About to load fileName.first = [%s]\n",fileName.first.c_str());
|
||||
|
||||
if(fileMustExist.first == true ||
|
||||
@ -204,6 +209,11 @@ Config::Config(std::pair<ConfigType,ConfigType> type, std::pair<string,string> f
|
||||
}
|
||||
fileName.second = userData + fileNameParameter.second;
|
||||
}
|
||||
|
||||
#if defined(WIN32)
|
||||
updatePathClimbingParts(fileName.second);
|
||||
#endif
|
||||
|
||||
}
|
||||
else if(cfgType.first == cfgMainKeys) {
|
||||
Config &mainCfg = Config::getInstance();
|
||||
@ -221,6 +231,11 @@ Config::Config(std::pair<ConfigType,ConfigType> type, std::pair<string,string> f
|
||||
}
|
||||
fileName.second = userData + fileNameParameter.second;
|
||||
}
|
||||
|
||||
#if defined(WIN32)
|
||||
updatePathClimbingParts(fileName.second);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("-=-=-=-=-=-=-= About to load fileName.second = [%s]\n",fileName.second.c_str());
|
||||
|
@ -572,6 +572,20 @@ void updatePathClimbingParts(string &path) {
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("CHANGED relative path from [%s] to [%s]\n",orig.c_str(),path.c_str());
|
||||
}
|
||||
|
||||
// Update paths with /./
|
||||
pos = path.find("/./");
|
||||
if(pos != string::npos && pos != 0) {
|
||||
string orig = path;
|
||||
path.erase(pos,2);
|
||||
pos--;
|
||||
|
||||
pos = path.find("/./");
|
||||
if(pos != string::npos && pos != 0) {
|
||||
updatePathClimbingParts(path);
|
||||
}
|
||||
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("CHANGED relative path from [%s] to [%s]\n",orig.c_str(),path.c_str());
|
||||
}
|
||||
|
||||
/*
|
||||
string::size_type pos = path.rfind("..");
|
||||
|
Loading…
x
Reference in New Issue
Block a user