From c6b75577f3bf3019399e0a439d9cccf55e53999f Mon Sep 17 00:00:00 2001 From: Patrick Lam Date: Wed, 2 Nov 2005 07:01:25 +0000 Subject: [PATCH] Forcibly rescan a directory before writing a fresh local cache file for that directory, fixing the losing-fonts problem reported by Mike Fabian and also apparently the font cache file corruption. --- ChangeLog | 8 ++++++++ fc-cache/fc-cache.c | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/ChangeLog b/ChangeLog index fdd56ee..7f1845f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-11-02 Patrick Lam + * fc-cache/fc-cache.c (scanDirs): + + Forcibly rescan a directory before writing a fresh local + cache file for that directory, fixing the losing-fonts + problem reported by Mike Fabian and also apparently the + font cache file corruption. + 2005-11-02 Patrick Lam * src/fccache.c (FcGlobalCacheLoad): diff --git a/fc-cache/fc-cache.c b/fc-cache/fc-cache.c index 388baa7..3a4b786 100644 --- a/fc-cache/fc-cache.c +++ b/fc-cache/fc-cache.c @@ -207,6 +207,15 @@ scanDirs (FcStrList *list, FcConfig *config, char *program, FcBool force, FcBool if (!FcDirCacheUnlink (dir)) ret++; + if (!FcDirScan (set, subdirs, 0, FcConfigGetBlanks (config), dir, FcTrue)) + { + fprintf (stderr, "\"%s\": error scanning\n", dir); + FcFontSetDestroy (set); + FcStrSetDestroy (subdirs); + ret++; + continue; + } + if (!FcDirSave (set, subdirs, dir)) { fprintf (stderr, "Can't save cache in \"%s\"\n", dir); -- 2.39.5