Merge pull request #9020 from krofna/krafixes

Core/ConfigReader: Expand ~ as the HOME envvar on UNIX-based platforms (requries that the HOME envvar has been set, it normally is)
This commit is contained in:
click
2013-01-22 12:59:18 -08:00
+9
View File
@@ -1121,6 +1121,15 @@ void World::LoadConfigSettings(bool reload)
if (dataPath.at(dataPath.length()-1) != '/' && dataPath.at(dataPath.length()-1) != '\\')
dataPath.push_back('/');
#if PLATFORM == PLATFORM_UNIX || PLATFORM == PLATFORM_APPLE
if (dataPath[0] == '~')
{
const char* home = getenv("HOME");
if (home)
dataPath.replace(0, 1, home);
}
#endif
if (reload)
{
if (dataPath != m_dataPath)