mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
source home directory from ${HOME}
This commit is contained in:
committed by
Baldur Karlsson
parent
672557f8fa
commit
5451acedc1
@@ -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/";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user