applications continue breaking.
+2005-10-31 Patrick Lam <plam@mit.edu>
+ * src/fcint.h:
+ * src/fclist.c (FcListAppend):
+ * src/fcmatch.c (FcFontRenderPrepare):
+ * src/fcpat.c (FcPatternTransferFullFname, FcPatternDuplicate,
+ FcPatternFreeze, FcPatternBaseFreeze):
+
+ Copy the full pathname whenever duplicating an FcPattern; otherwise,
+ applications continue breaking.
+
2005-10-31 Patrick Lam <plam@mit.edu>
* fc-cat/fc-cat.c (FcCacheFileRead, main):
* src/fcfreetype.c (FcFreeTypeQuery):
void
FcPatternAddFullFname (const FcPattern *p, const char *fname);
-const char *
-FcPatternFindFullFname (const FcPattern *p);
+void
+FcPatternTransferFullFname (const FcPattern *new, const FcPattern *orig);
const FcChar8 *
FcStrStaticName (const FcChar8 *name);
/* Also, copy over the full path info. */
if (!strcmp (os->objects[o], FC_FILE))
- {
- FcChar8 * s;
- FcPatternGetString (font, FC_FILE, 0, &s);
- FcPatternAddFullFname (bucket->pattern, FcPatternFindFullFname(font));
- }
+ FcPatternTransferFullFname (bucket->pattern, font);
e = FcPatternFindElt (font, os->objects[o]);
if (e)
FcPatternAdd (new, FcObjectPtrU(pe->object),
FcValueCanonicalize(&FcValueListPtrU(pe->values)->value), FcTrue);
}
+
+ if (FcPatternFindElt (font, FC_FILE))
+ FcPatternTransferFullFname (new, font);
+
FcConfigSubstituteWithPat (config, new, pat, FcMatchFont);
return new;
}
static FcValueList ** fcvaluelists = 0;
static int fcvaluelist_bank_count = 0, fcvaluelist_ptr, fcvaluelist_count;
+static const char *
+FcPatternFindFullFname (const FcPattern *p);
static FcPatternEltPtr
FcPatternEltPtrCreateDynamic (FcPatternElt * e);
(FcPatternEltU(b->elts)+i)->object;
}
+ if (FcPatternFindElt (b, FC_FILE))
+ FcPatternTransferFullFname (ep, b);
+
ent->hash = hash;
ent->next = *bucket;
*bucket = ent;
if (!FcValueListPtrU((FcPatternEltU(p->elts)+i)->values))
goto bail;
}
+
+ if (FcPatternFindElt (p, FC_FILE))
+ FcPatternTransferFullFname (b, p);
+
/*
* Freeze base
*/
FcValueCanonicalize(&FcValueListPtrU(l)->value),
FcTrue))
goto bail1;
+
+ if (!strcmp ((char *)FcObjectPtrU((e + i)->object), FC_FILE))
+ {
+ FcChar8 * s;
+ FcPatternGetString (orig, FC_FILE, 0, &s);
+ FcPatternAddFullFname (new, FcPatternFindFullFname(orig));
+ }
}
return new;
pb->next->m.fname = fname;
}
-const char *
+static const char *
FcPatternFindFullFname (const FcPattern *p)
{
struct patternDirBucket *pb;
return 0;
}
+void
+FcPatternTransferFullFname (const FcPattern *new, const FcPattern *orig)
+{
+ FcChar8 * s;
+ FcPatternGetString (orig, FC_FILE, 0, &s);
+ FcPatternAddFullFname (new, FcPatternFindFullFname(orig));
+}