[Fontconfig] fontconfig: Branch 'master'

Keith Packard keithp at kemper.freedesktop.org
Fri Oct 27 10:28:40 PDT 2006


 fc-cache/fc-cache.c |    9 +++++++++
 1 files changed, 9 insertions(+)

New commits:
diff-tree 0334e5a294dd6a36c94936f6c9c709e86773cf64 (from 0596d7296c94b2bb9817338b8c1a76da91673fb9)
Author: Mike FABIAN <mfabian at suse.de>
Date:   Fri Oct 27 10:26:50 2006 -0700

    Do not clean cache files for different architectures
    
    Use filenames to clean cache files for current architecture only. This is
    sufficient as cache files live in their own directory where filenames are
    under fontconfig control.

diff --git a/fc-cache/fc-cache.c b/fc-cache/fc-cache.c
index bda8b14..acaa8ba 100644
--- a/fc-cache/fc-cache.c
+++ b/fc-cache/fc-cache.c
@@ -22,6 +22,8 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
+#include "../fc-arch/fcarch.h"
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #else
@@ -40,6 +42,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <dirent.h>
+#include <string.h>
 
 #if defined (_WIN32)
 #define STRICT
@@ -296,6 +299,12 @@ cleanCacheDirectory (FcConfig *config, F
 
 	if (ent->d_name[0] == '.')
 	    continue;
+	/* skip cache files for different architectures and */
+	/* files which are not cache files at all */
+	if (strlen(ent->d_name) != 32 + strlen ("-" FC_ARCHITECTURE FC_CACHE_SUFFIX) ||
+	    strcmp(ent->d_name + 32, "-" FC_ARCHITECTURE FC_CACHE_SUFFIX))
+	    continue;
+	
 	file_name = FcStrPlus (dir_base, (FcChar8 *) ent->d_name);
 	if (!file_name)
 	{


More information about the Fontconfig mailing list