From 0394cb7829d16a902e2eebdcc4f00db3774916b8 Mon Sep 17 00:00:00 2001 From: Akira TAGOH Date: Mon, 5 Feb 2018 13:31:00 +0900 Subject: [PATCH] Ensure the user config dir is available in the list of config dirs on the fallback config --- src/fcinit.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/fcinit.c b/src/fcinit.c index 30646dc..5831a19 100644 --- a/src/fcinit.c +++ b/src/fcinit.c @@ -39,15 +39,23 @@ static FcConfig * FcInitFallbackConfig (const FcChar8 *sysroot) { FcConfig *config; + const FcChar8 *fallback = (const FcChar8 *) "" \ + "" \ + " " FC_DEFAULT_FONTS "" \ + " fonts" \ + " " FC_CACHEDIR "" \ + " fontconfig" \ + " fontconfig/conf.d" \ + " fontconfig/fonts.conf" \ + ""; config = FcConfigCreate (); if (!config) goto bail0; FcConfigSetSysRoot (config, sysroot); - if (!FcConfigAddFontDir (config, (FcChar8 *) FC_DEFAULT_FONTS)) - goto bail1; - if (!FcConfigAddCacheDir (config, (FcChar8 *) FC_CACHEDIR)) + if (!FcConfigParseAndLoadFromMemory (config, fallback, FcFalse)) goto bail1; + return config; bail1: