scan subdirectories once.
+2006-01-26 Patrick Lam <plam@mit.edu>
+ * src/fccache.c (FcDirCacheValid, FcDirCacheHasCurrentArch):
+ * src/fccfg.c (FcConfigNormalizeFontDir):
+
+ Add a couple of missing normalizations to make fc-cache work
+ right; only scan subdirectories once.
+
2006-01-26 Mike Fabian <mfabian@suse.de>
reviewed by: plam
struct stat file_stat, dir_stat;
int fd;
+ dir = FcConfigNormalizeFontDir (FcConfigGetCurrent(), dir);
+ if (!dir)
+ return FcFalse;
+
if (stat ((char *) dir, &dir_stat) < 0)
return FcFalse;
off_t current_arch_start;
char *current_arch_machine_name;
+ dir = FcConfigNormalizeFontDir (FcConfigGetCurrent(), dir);
+ if (!dir)
+ return FcFalse;
+
fd = FcDirCacheOpen (dir);
if (fd < 0)
goto bail;
/* If this is a bottleneck, we can cache the fontDir inodes. */
ino_t di;
dev_t dd;
- int n;
+ int n, n0;
struct stat s;
if (stat ((char *)d, &s) == -1)
}
/* Ok, we didn't find it in fontDirs; let's add subdirs.... */
- for (n = 0; n < config->fontDirs->num; n++)
+ for (n = 0, n0 = config->fontDirs->num; n < n0; n++)
FcConfigAddFontDirSubdirs (config, config->fontDirs->strs[n]);
/* ... and try again. */