summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Lam <plam@MIT.EDU>2005-11-29 06:09:18 +0000
committerPatrick Lam <plam@MIT.EDU>2005-11-29 06:09:18 +0000
commit51af0509925e780eb3eb9014aac5e50b6bbbe0d1 (patch)
tree8b35049097a53f34fd3833183313a07fa6b175d8
parente0421d0289ae95a1c74e607f36c0d54f3d0dedd8 (diff)
downloadfontconfig-51af0509925e780eb3eb9014aac5e50b6bbbe0d1.tar.gz
Don't make FcPatternFindFullFname available to fccfg, it's not really safe.
Instead go through FcPatternGetString (sorry, perf guys.) Also, use globs for dirs as well.
-rw-r--r--ChangeLog9
-rw-r--r--src/fccfg.c8
-rw-r--r--src/fcint.h3
-rw-r--r--src/fcpat.c5
4 files changed, 18 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index e41b484..0c577e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2005-11-29 Patrick Lam <plam@mit.edu>
+ * src/fccfg.c (FcConfigBuildFonts):
+ * src/fcint.h:
+ * src/fcpat.c (FcPatternFindFullFname):
+
+ Don't make FcPatternFindFullFname available to fccfg, it's not
+ really safe. Instead go through FcPatternGetString (sorry,
+ perf guys.) Also, use globs for dirs as well.
+
2005-11-28 Patrick Lam <plam@mit.edu>
* src/fccfg.c (FcConfigBuildFonts):
diff --git a/src/fccfg.c b/src/fccfg.c
index f021979..00510e5 100644
--- a/src/fccfg.c
+++ b/src/fccfg.c
@@ -308,11 +308,13 @@ FcConfigBuildFonts (FcConfig *config)
for (i = 0; i < cached_fonts->nfont; i++)
{
- const char * cfn = (FcChar8 *)FcPatternFindFullFname
- (cached_fonts->fonts[i]);
+ FcChar8 *cfn, *cfd;
+ FcPatternGetString (cached_fonts->fonts[i], FC_FILE, 0, &cfn);
+ cfd = (FcChar8 *)FcCacheFindBankDir (cached_fonts->fonts[i]->bank);
if (FcConfigAcceptFont (config, cached_fonts->fonts[i]) &&
- (cfn && FcConfigAcceptFilename (config, cfn)))
+ (cfn && FcConfigAcceptFilename (config, cfn)) &&
+ (cfd && FcConfigAcceptFilename (config, cfd)))
FcFontSetAdd (fonts, cached_fonts->fonts[i]);
cached_fonts->fonts[i] = 0; /* prevent free in FcFontSetDestroy */
diff --git a/src/fcint.h b/src/fcint.h
index 9b833f7..561c5cb 100644
--- a/src/fcint.h
+++ b/src/fcint.h
@@ -848,9 +848,6 @@ FcPatternAppend (FcPattern *p, FcPattern *s);
void
FcPatternAddFullFname (const FcPattern *p, const char *fname);
-const char *
-FcPatternFindFullFname (const FcPattern *p);
-
void
FcPatternTransferFullFname (const FcPattern *new, const FcPattern *orig);
diff --git a/src/fcpat.c b/src/fcpat.c
index cba9991..834bb5e 100644
--- a/src/fcpat.c
+++ b/src/fcpat.c
@@ -37,6 +37,9 @@ static int fcvaluelist_bank_count = 0, fcvaluelist_ptr, fcvaluelist_count;
static FcPatternEltPtr
FcPatternEltPtrCreateDynamic (FcPatternElt * e);
+static const char *
+FcPatternFindFullFname (const FcPattern *p);
+
/* If you are trying to duplicate an FcPattern which will be used for
* rendering, be aware that (internally) you also have to use
* FcPatternTransferFullFname to transfer the associated filename. If
@@ -2014,7 +2017,7 @@ FcPatternAddFullFname (const FcPattern *p, const char *fname)
pb->next->m.fname = fname;
}
-const char *
+static const char *
FcPatternFindFullFname (const FcPattern *p)
{
struct patternDirBucket *pb;