diff options
author | marha <marha@users.sourceforge.net> | 2012-05-21 09:10:35 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-05-21 09:10:35 +0200 |
commit | f543ceaca6820260f15a4eff86938214cf43c7d2 (patch) | |
tree | d66901c0385bd008ba46600be695c500daa78c8f /fontconfig/src/fcinit.c | |
parent | 062c45ff0df6a52080dcd74433710d47127cbe29 (diff) | |
download | vcxsrv-f543ceaca6820260f15a4eff86938214cf43c7d2.tar.gz vcxsrv-f543ceaca6820260f15a4eff86938214cf43c7d2.tar.bz2 vcxsrv-f543ceaca6820260f15a4eff86938214cf43c7d2.zip |
fontconfig mesa xkeyboard-config xserver pixman git update 21 Mar 2012
Diffstat (limited to 'fontconfig/src/fcinit.c')
-rw-r--r-- | fontconfig/src/fcinit.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/fontconfig/src/fcinit.c b/fontconfig/src/fcinit.c index abf64b57f..ab6401215 100644 --- a/fontconfig/src/fcinit.c +++ b/fontconfig/src/fcinit.c @@ -72,21 +72,37 @@ FcInitLoadConfig (void) if (config->cacheDirs && config->cacheDirs->num == 0) { + FcChar8 *prefix; + size_t plen; + fprintf (stderr, "Fontconfig warning: no <cachedir> elements found. Check configuration.\n"); fprintf (stderr, "Fontconfig warning: adding <cachedir>%s</cachedir>\n", FC_CACHEDIR); + prefix = FcConfigXdgCacheHome (); + plen = prefix ? strlen ((const char *)prefix) : 0; + if (!prefix) + goto bail; + prefix = realloc (prefix, plen + 12); + if (!prefix) + goto bail; + memcpy (&prefix[plen], FC_DIR_SEPARATOR_S "fontconfig", 11); + prefix[plen + 11] = 0; fprintf (stderr, - "Fontconfig warning: adding <cachedir>~/.fontconfig</cachedir>\n"); + "Fontconfig warning: adding <cachedir prefix=\"xdg\">fontconfig</cachedir>\n"); + if (!FcConfigAddCacheDir (config, (FcChar8 *) FC_CACHEDIR) || - !FcConfigAddCacheDir (config, (FcChar8 *) "~/.fontconfig")) + !FcConfigAddCacheDir (config, (FcChar8 *) prefix)) { + bail: fprintf (stderr, "Fontconfig error: out of memory"); + free (prefix); FcConfigDestroy (config); return FcInitFallbackConfig (); } + free (prefix); } return config; |