enable absolute paths in --config-dir on non-windows OS-es

This commit is contained in:
Timotei Dolean 2010-07-24 16:26:59 +00:00
parent 9dfc4d6e74
commit 34c7f1190d

View file

@ -536,7 +536,11 @@ void set_preferences_dir(std::string path)
} else {
other:
std::string home = home_str ? home_str : ".";
game_config::preferences_dir = home + "/" + path;
if (path[0] == '/')
game_config::preferences_dir = path;
else
game_config::preferences_dir = home + "/" + path;
}
#else
if (path.empty()) path = path2;
@ -556,7 +560,11 @@ void set_preferences_dir(std::string path)
#else
const char* home_str = getenv("HOME");
std::string home = home_str ? home_str : ".";
game_config::preferences_dir = home + std::string("/") + path;
if (path[0] == '/')
game_config::preferences_dir = path;
else
game_config::preferences_dir = home + std::string("/") + path;
#endif
#endif