Use $HOME variable if it exists
Signed-off-by: Ismail Dönmez <ismail@i10z.com>
This commit is contained in:
parent
204500117d
commit
d9a920b062
|
@ -859,14 +859,21 @@ namespace gourou
|
||||||
std::string DRMProcessor::getDefaultAdeptDir(void)
|
std::string DRMProcessor::getDefaultAdeptDir(void)
|
||||||
{
|
{
|
||||||
#ifndef DEFAULT_ADEPT_DIR
|
#ifndef DEFAULT_ADEPT_DIR
|
||||||
const char* user = getenv("USER");
|
const char* home = getenv("HOME");
|
||||||
|
|
||||||
if (user && user[0])
|
if (home)
|
||||||
{
|
return home + std::string("/.config/adept/");
|
||||||
return std::string("/home/") + user + std::string("/.config/adept/");
|
else
|
||||||
}
|
{
|
||||||
else
|
const char* user = getenv("USER");
|
||||||
return LOCAL_ADEPT_DIR;
|
|
||||||
|
if (user && user[0])
|
||||||
|
{
|
||||||
|
return std::string("/home/") + user + std::string("/.config/adept/");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return LOCAL_ADEPT_DIR;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
return DEFAULT_ADEPT_DIR "/";
|
return DEFAULT_ADEPT_DIR "/";
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue
Block a user