libsaria: Check if $HOME is part of $XDG_CONFIG_HOME
On one machine it is, on another it isn't. This should be a solution that works for everybody.
This commit is contained in:
parent
83867dba2c
commit
304b581274
|
@ -61,13 +61,15 @@ void readdir(string dir, list<file> &files, list<file> &dirs)
|
|||
string get_saria_dir()
|
||||
{
|
||||
string saria = getenv("HOME");
|
||||
char *xdg = getenv("XDG_CONFIG_HOME");
|
||||
string xdg = getenv("XDG_CONFIG_HOME");
|
||||
|
||||
saria += "/";
|
||||
if (xdg != NULL)
|
||||
saria += xdg;
|
||||
if (xdg == "")
|
||||
saria += "/.config";
|
||||
else if (xdg.compare(0, saria.size(), saria) == 0)
|
||||
saria = xdg + "/";
|
||||
else
|
||||
saria += ".config";
|
||||
saria += "/" + xdg += "/";
|
||||
|
||||
return saria += SARIA_DIR;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue