Don't read/write from/to the XDG dirs even if XDG_*_HOME is set
and the home directory is disabled.
This commit is contained in:
Akira TAGOH 2014-06-30 15:12:32 +09:00
parent 5004e8e01f
commit dab60e4476
1 changed files with 9 additions and 15 deletions

View File

@ -2009,17 +2009,15 @@ FcConfigXdgCacheHome (void)
const char *env = getenv ("XDG_CACHE_HOME");
FcChar8 *ret = NULL;
if (!_FcConfigHomeEnabled)
return NULL;
if (env)
ret = FcStrCopy ((const FcChar8 *)env);
else
{
const FcChar8 *home = FcConfigHome ();
size_t len;
size_t len = home ? strlen ((const char *)home) : 0;
if (!home)
return NULL;
len = strlen ((const char *)home);
ret = malloc (len + 7 + 1);
if (ret)
{
@ -2038,17 +2036,15 @@ FcConfigXdgConfigHome (void)
const char *env = getenv ("XDG_CONFIG_HOME");
FcChar8 *ret = NULL;
if (!_FcConfigHomeEnabled)
return NULL;
if (env)
ret = FcStrCopy ((const FcChar8 *)env);
else
{
const FcChar8 *home = FcConfigHome ();
size_t len;
size_t len = home ? strlen ((const char *)home) : 0;
if (!home)
return NULL;
len = strlen ((const char *)home);
ret = malloc (len + 8 + 1);
if (ret)
{
@ -2067,17 +2063,15 @@ FcConfigXdgDataHome (void)
const char *env = getenv ("XDG_DATA_HOME");
FcChar8 *ret = NULL;
if (!_FcConfigHomeEnabled)
return NULL;
if (env)
ret = FcStrCopy ((const FcChar8 *)env);
else
{
const FcChar8 *home = FcConfigHome ();
size_t len;
size_t len = home ? strlen ((const char *)home) : 0;
if (!home)
return NULL;
len = strlen ((const char *)home);
ret = malloc (len + 13 + 1);
if (ret)
{