+2005-10-21 Patrick Lam <plam@mit.edu>
+ * src/fccache.c (FcGlobalCacheLoad):
+
+ Destroy the global cache file if it's terminally broken. (reported by
+ Mike Fabian)
+
2005-10-21 Patrick Lam <plam@mit.edu>
* fc-list/fc-list.c (main):
* src/fcname.c (FcNameUnparse, FcNameUnparseEscaped):
* fontconfig/fontconfig.h:
- Prevent fc-list from escaping strings when printing them.
+ Prevent fc-list from escaping strings when printing them (reported by
+ Matthias Clasen).
2005-10-20 Marcus Meissner <meissner@suse.de>
reviewed by: plam
current_arch_start = FcCacheSkipToArch(cache->fd,
current_arch_machine_name);
if (current_arch_start < 0)
- goto bail0;
+ goto bail_and_destroy;
lseek (cache->fd, current_arch_start, SEEK_SET);
FcCacheReadString (cache->fd, candidate_arch_machine_name,
sizeof (candidate_arch_machine_name));
if (strlen(candidate_arch_machine_name) == 0)
- goto bail0;
+ goto bail_and_destroy;
while (1)
{
free (d);
}
cache->dirs = 0;
- bail0:
+
close (cache->fd);
cache->fd = -1;
return;
+
+ bail_and_destroy:
+ close (cache->fd);
+ cache->fd = -1;
+
+ if (stat ((char *) cache_file, &cache_stat) == 0)
+ unlink ((char *)cache_file);
+
+ return;
+
}
FcBool