source home directory from ${HOME}

This commit is contained in:
Oliver Enseling
2022-11-03 13:54:22 +00:00
committed by Baldur Karlsson
parent 672557f8fa
commit 5451acedc1
+10 -1
View File
@@ -596,7 +596,16 @@ rdcstr GetTempRootPath()
rdcstr GetAppFolderFilename(const rdcstr &filename)
{
passwd *pw = getpwuid(getuid());
const char *homedir = pw->pw_dir;
const char *homedir = pw ? pw->pw_dir : NULL;
if(!homedir)
homedir = getenv("HOME");
if(!homedir)
{
RDCERR("Can't get HOME directory, defaulting to '/' instead");
homedir = "";
}
rdcstr ret = rdcstr(homedir) + "/.renderdoc/";