Fall back to HOME if XDG_CONFIG_HOME doesn't exist
This commit is contained in:
parent
c8e547343b
commit
49365b3d98
1 changed files with 8 additions and 5 deletions
|
|
@ -191,6 +191,7 @@ std::string ResourceManager::GetConfigurationDirectory()
|
|||
{
|
||||
std::string config_dir = "";
|
||||
const char* xdg_config_home = getenv("XDG_CONFIG_HOME");
|
||||
const char* home = getenv("HOME");
|
||||
const char* appdata = getenv("APPDATA");
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
|
|
@ -201,12 +202,14 @@ std::string ResourceManager::GetConfigurationDirectory()
|
|||
{
|
||||
config_dir = xdg_config_home;
|
||||
}
|
||||
else
|
||||
else if(appdata != NULL)
|
||||
{
|
||||
if(appdata != NULL)
|
||||
{
|
||||
config_dir = appdata;
|
||||
}
|
||||
config_dir = appdata;
|
||||
}
|
||||
else if(home != NULL)
|
||||
{
|
||||
config_dir = home;
|
||||
config_dir = config_dir + "/.config";
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue