Rework for 5004e8e01f
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:
parent
5004e8e01f
commit
dab60e4476
24
src/fccfg.c
24
src/fccfg.c
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue