]> git.wh0rd.org - fontconfig.git/blobdiff - src/fccache.c
Global cache time checking was using wrong file name and computing wrong
[fontconfig.git] / src / fccache.c
index 3a7cb6ced0495d57bb050c59936443d1a6c1d83f..ab32629e2847bba392308c06aacb8461633734d2 100644 (file)
@@ -309,14 +309,14 @@ FcCacheHash (const FcChar8 *string, int len)
  * Verify the saved timestamp for a file
  */
 FcBool
-FcGlobalCacheCheckTime (FcGlobalCacheInfo *info)
+FcGlobalCacheCheckTime (const FcChar8 *file, FcGlobalCacheInfo *info)
 {
     struct stat            statb;
 
-    if (stat ((char *) info->file, &statb) < 0)
+    if (stat ((char *) file, &statb) < 0)
     {
        if (FcDebug () & FC_DBG_CACHE)
-           printf (" file missing\n");
+           printf (" file %s missing\n", file);
        return FcFalse;
     }
     if (statb.st_mtime != info->time)
@@ -549,7 +549,7 @@ FcGlobalCacheScanDir (FcFontSet             *set,
      * See if the timestamp recorded in the global cache
      * matches the directory time, if not, return False
      */
-    if (!FcGlobalCacheCheckTime (&d->info))
+    if (!FcGlobalCacheCheckTime (d->info.file, &d->info))
     {
        if (FcDebug () & FC_DBG_CACHE)
            printf ("\tdir cache entry time mismatch\n");
@@ -633,7 +633,7 @@ FcGlobalCacheFileGet (FcGlobalCache *cache,
        }
     }
     if (count)
-       *count = max;
+       *count = max + 1;
     return match;
 }