libsaria: Use absolute paths for saria dirs
I noticed that new save files weren't being created. I now use the HOME environment variable to construct an absolute path to write files to.
This commit is contained in:
parent
a14cedc942
commit
0b4d9c25eb
|
@ -60,10 +60,14 @@ void readdir(string dir, list<file> &files, list<file> &dirs)
|
|||
|
||||
string get_saria_dir()
|
||||
{
|
||||
string saria = ".config";
|
||||
char *xdg = getenv("XDG_CONFIG_HOME");
|
||||
string saria = getenv("HOME");
|
||||
char *xdg = getenv("XDG_CONFIG_HOME");
|
||||
|
||||
saria += "/";
|
||||
if (xdg != NULL)
|
||||
saria = xdg;
|
||||
saria += xdg;
|
||||
else
|
||||
saria += ".config";
|
||||
return saria += SARIA_DIR;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue