summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2003-06-26 00:39:04 +0000
committerKeith Packard <keithp@keithp.com>2003-06-26 00:39:04 +0000
commitee1debfdd9bae347e8bec29c0cbd668640a2aadf (patch)
treed38acd7479927b3ee341f203fb8fdb2eb4c2ceec
parent79621aa5c786cdd4d14b43b58888979ef0d2a4c6 (diff)
Allow config->cache to be null (as it is when $HOME is not set)
-rw-r--r--src/fccfg.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/fccfg.c b/src/fccfg.c
index 709cd42..fd87cb6 100644
--- a/src/fccfg.c
+++ b/src/fccfg.c
@@ -178,7 +178,8 @@ FcConfigDestroy (FcConfig *config)
FcStrSetDestroy (config->acceptGlobs);
FcStrSetDestroy (config->rejectGlobs);
- FcStrFree (config->cache);
+ if (config->cache)
+ FcStrFree (config->cache);
FcSubstDestroy (config->substPattern);
FcSubstDestroy (config->substFont);
@@ -211,7 +212,8 @@ FcConfigBuildFonts (FcConfig *config)
if (!cache)
goto bail1;
- FcGlobalCacheLoad (cache, config->cache);
+ if (config->cache)
+ FcGlobalCacheLoad (cache, config->cache);
list = FcConfigGetFontDirs (config);
if (!list)
@@ -230,7 +232,8 @@ FcConfigBuildFonts (FcConfig *config)
if (FcDebug () & FC_DBG_FONTSET)
FcFontSetPrint (fonts);
- FcGlobalCacheSave (cache, config->cache);
+ if (config->cache)
+ FcGlobalCacheSave (cache, config->cache);
FcGlobalCacheDestroy (cache);
FcConfigSetFonts (config, fonts, FcSetSystem);