aboutsummaryrefslogtreecommitdiff
path: root/fontconfig/src/fcxml.c
diff options
context:
space:
mode:
Diffstat (limited to 'fontconfig/src/fcxml.c')
-rw-r--r--fontconfig/src/fcxml.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/fontconfig/src/fcxml.c b/fontconfig/src/fcxml.c
index 3dc1357b7..29dd4d654 100644
--- a/fontconfig/src/fcxml.c
+++ b/fontconfig/src/fcxml.c
@@ -2051,7 +2051,14 @@ FcParseDir (FcConfigParse *parse)
attr = FcConfigGetAttribute (parse, "prefix");
if (attr && FcStrCmp (attr, (const FcChar8 *)"xdg") == 0)
+ {
prefix = FcConfigXdgDataHome ();
+ /* home directory might be disabled.
+ * simply ignore this element.
+ */
+ if (!prefix)
+ goto bail;
+ }
data = FcStrBufDoneStatic (&parse->pstack->str);
if (!data)
{
@@ -2142,11 +2149,18 @@ static void
FcParseCacheDir (FcConfigParse *parse)
{
const FcChar8 *attr;
- FcChar8 *prefix = NULL, *p, *data;
+ FcChar8 *prefix = NULL, *p, *data = NULL;
attr = FcConfigGetAttribute (parse, "prefix");
if (attr && FcStrCmp (attr, (const FcChar8 *)"xdg") == 0)
+ {
prefix = FcConfigXdgCacheHome ();
+ /* home directory might be disabled.
+ * simply ignore this element.
+ */
+ if (!prefix)
+ goto bail;
+ }
data = FcStrBufDone (&parse->pstack->str);
if (!data)
{
@@ -2254,7 +2268,14 @@ FcParseInclude (FcConfigParse *parse)
deprecated = FcTrue;
attr = FcConfigGetAttribute (parse, "prefix");
if (attr && FcStrCmp (attr, (const FcChar8 *)"xdg") == 0)
+ {
prefix = FcConfigXdgConfigHome ();
+ /* home directory might be disabled.
+ * simply ignore this element.
+ */
+ if (!prefix)
+ goto bail;
+ }
if (prefix)
{
size_t plen = strlen ((const char *)prefix);