+2005-10-03 Patrick Lam <plam@mit.edu>
+ * src/fccache.c (FcDirCacheValid):
+
+ Ensure that a directory cache has the appropriate section
+ before reporting that it is valid (reported by Matthias Clasen).
+
2005-09-29 Mathias Hasselmann <mathias.hasselmann@gmx.de>
reviewed by: plam
{
FcChar8 *cache_file = FcStrPlus (dir, (FcChar8 *) "/" FC_DIR_CACHE_FILE);
struct stat file_stat, dir_stat;
+ int fd;
+ off_t current_arch_start;
+ char *current_arch_machine_name;
if (stat ((char *) dir, &dir_stat) < 0)
{
FcStrFree (cache_file);
return FcFalse;
}
+
+ current_arch_machine_name = FcCacheMachineSignature();
+ fd = open(cache_file, O_RDONLY);
+ if (fd == -1)
+ return FcFalse;
+
+ current_arch_start = FcCacheSkipToArch(fd, current_arch_machine_name);
+ close (fd);
+
+ if (current_arch_start < 0)
+ return FcFalse;
+
FcStrFree (cache_file);
/*
* If the directory has been modified more recently than