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.
* PERFORMANCE OF THIS SOFTWARE.
*/
+#include "../fc-arch/fcarch.h"
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#else
#include <errno.h>
#include <fcntl.h>
#include <dirent.h>
+#include <string.h>
#if defined (_WIN32)
#define STRICT
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)
{