]> git.wh0rd.org - fontconfig.git/commitdiff
Allow config->cache to be null (as it is when $HOME is not set) (2.2
authorKeith Packard <keithp@keithp.com>
Thu, 26 Jun 2003 00:39:56 +0000 (00:39 +0000)
committerKeith Packard <keithp@keithp.com>
Thu, 26 Jun 2003 00:39:56 +0000 (00:39 +0000)
    branch)

src/fccfg.c

index 36a76a416c5619f54987872232dfe2c805ebb357..8d32db8fc1cf6b8b3ade862611c865269a34b415 100644 (file)
@@ -160,7 +160,8 @@ FcConfigDestroy (FcConfig *config)
     FcStrSetDestroy (config->fontDirs);
     FcStrSetDestroy (config->configFiles);
 
-    FcStrFree (config->cache);
+    if (config->cache)
+       FcStrFree (config->cache);
 
     FcSubstDestroy (config->substPattern);
     FcSubstDestroy (config->substFont);
@@ -193,7 +194,8 @@ FcConfigBuildFonts (FcConfig *config)
     if (!cache)
        goto bail1;
 
-    FcGlobalCacheLoad (cache, config->cache);
+    if (config->cache)
+       FcGlobalCacheLoad (cache, config->cache);
 
     list = FcConfigGetFontDirs (config);
     if (!list)
@@ -211,7 +213,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);