summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Lam <plam@MIT.EDU>2006-01-27 05:47:59 +0000
committerPatrick Lam <plam@MIT.EDU>2006-01-27 05:47:59 +0000
commit97293e07dd688b3d81cd6e7ecd5df4cdef4c87d8 (patch)
tree1a5d4d11102577ab2e88b0f29f7eeb66869d51eb
parent3cf9f5cec386ce97bb3cdd1dfe78d0d6999243ea (diff)
Move FcConfigNormalizeFontDir call so that it doesn't result in infinite
recursion (reported by Ronny V. Vindenes).
-rw-r--r--ChangeLog9
-rw-r--r--fc-cache/fc-cache.c6
-rw-r--r--fontconfig/fontconfig.h4
-rw-r--r--src/fccache.c8
-rw-r--r--src/fcint.h4
5 files changed, 18 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index e85113bc..0975c223 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-01-27 Patrick Lam <plam@mit.edu>
+ * fc-cache/fc-cache.c (scanDirs):
+ * fontconfig/fontconfig.h:
+ * src/fcint.h:
+ * src/fccache.c (FcDirCacheValid, FcDirCacheHasCurrentArch):
+
+ Move FcConfigNormalizeFontDir call so that it doesn't result in
+ infinite recursion (reported by Ronny V. Vindenes).
+
2006-01-26 Patrick Lam <plam@mit.edu>
* src/fccache.c (FcDirCacheValid, FcDirCacheHasCurrentArch):
* src/fccfg.c (FcConfigNormalizeFontDir):
diff --git a/fc-cache/fc-cache.c b/fc-cache/fc-cache.c
index 4900e45e..2d6c2c31 100644
--- a/fc-cache/fc-cache.c
+++ b/fc-cache/fc-cache.c
@@ -112,7 +112,7 @@ static int
scanDirs (FcStrList *list, FcConfig *config, char *program, FcBool force, FcBool verbose)
{
int ret = 0;
- FcChar8 *dir;
+ const FcChar8 *dir;
FcFontSet *set;
FcStrSet *subdirs;
FcStrList *sublist;
@@ -124,6 +124,10 @@ scanDirs (FcStrList *list, FcConfig *config, char *program, FcBool force, FcBool
*/
while ((dir = FcStrListNext (list)))
{
+ dir = FcConfigNormalizeFontDir (config, dir);
+ if (!dir)
+ return FcFalse;
+
if (verbose)
{
printf ("%s: \"%s\": ", program, dir);
diff --git a/fontconfig/fontconfig.h b/fontconfig/fontconfig.h
index 15495936..0bcef194 100644
--- a/fontconfig/fontconfig.h
+++ b/fontconfig/fontconfig.h
@@ -328,6 +328,10 @@ FcConfigBuildFonts (FcConfig *config);
FcStrList *
FcConfigGetFontDirs (FcConfig *config);
+const FcChar8 *
+FcConfigNormalizeFontDir (FcConfig *config,
+ const FcChar8 *d);
+
FcStrList *
FcConfigGetConfigDirs (FcConfig *config);
diff --git a/src/fccache.c b/src/fccache.c
index 84915515..a687483b 100644
--- a/src/fccache.c
+++ b/src/fccache.c
@@ -609,10 +609,6 @@ FcDirCacheValid (const FcChar8 *dir)
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;
@@ -648,10 +644,6 @@ FcDirCacheHasCurrentArch (const FcChar8 *dir)
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;
diff --git a/src/fcint.h b/src/fcint.h
index 48f209e5..b77b50d0 100644
--- a/src/fcint.h
+++ b/src/fcint.h
@@ -496,10 +496,6 @@ FcBool
FcConfigAddConfigFile (FcConfig *config,
const FcChar8 *f);
-const FcChar8 *
-FcConfigNormalizeFontDir (FcConfig *config,
- const FcChar8 *d);
-
FcBool
FcConfigSetCache (FcConfig *config,
const FcChar8 *c);