]> git.wh0rd.org - fontconfig.git/blobdiff - src/fcdir.c
Add test for validity of directory caches that somehow got lost (reported
[fontconfig.git] / src / fcdir.c
index 4ee84def97190cddd50c9ad34ceedb0f6661cd00..5452b60ca6f91daf2c6da51610faac751e7fbb29 100644 (file)
@@ -136,7 +136,10 @@ FcDirScanConfig (FcFontSet *set,
        /*
         * Check ~/.fonts.cache-<version> file
         */
-       if (cache && FcGlobalCacheReadDir (set, dirs, cache, dir, config))
+       if (cache && FcGlobalCacheReadDir (set, dirs, cache, (char *)dir, config))
+           return FcTrue;
+
+       if (FcDirCacheValid (dir) && FcDirCacheRead (set, dirs, dir))
            return FcTrue;
     }
     
@@ -184,7 +187,7 @@ FcDirScanConfig (FcFontSet  *set,
      * add the cache entry 
      */
     if (ret && cache)
-       FcGlobalCacheUpdate (cache, dir, tmpSet);
+       FcGlobalCacheUpdate (cache, (char *)dir, tmpSet);
 
     for (i = 0; i < tmpSet->nfont; i++)
        FcFontSetAdd (set, tmpSet->fonts[i]);
@@ -212,7 +215,7 @@ FcDirScan (FcFontSet            *set,
 }
 
 FcBool
-FcDirSave (FcFontSet *set, const FcChar8 *dir)
+FcDirSave (FcFontSet *set, FcStrSet * dirs, const FcChar8 *dir)
 {
-    return FcDirCacheWrite (set, dir);
+    return FcDirCacheWrite (set, dirs, dir);
 }