Commit 5fe09702 authored by Patrick Lam's avatar Patrick Lam
Browse files

Print out full pathname in fc-match -v as well. Reported by Frederic

    Crozat.
Fix bug where fc-match crashes when given __DUMMY__ property to match on.
(I added the __DUMMY__ string to enable callers of FcObjectToPtrLookup to
    distinguish an error return from a successful return. -PL)
reviewed by: plam
parent c60ec7cc
2006-01-06 Patrick Lam <plam@mit.edu>
* src/fcdbg.c (FcPatternPrint):
Print out full pathname in fc-match -v as well. Reported by
Frederic Crozat.
2006-01-06 Mike Fabian <mfabian@suse.de>
reviewed by: plam
* src/fcname.c (FcNameParse):
Fix bug where fc-match crashes when given __DUMMY__ property to
match on.
(I added the __DUMMY__ string to enable callers of
FcObjectToPtrLookup to distinguish an error return from a
successful return. -PL)
2006-01-05 Patrick Lam <plam@mit.edu>
* AUTHORS:
......
......@@ -111,7 +111,26 @@ FcPatternPrint (const FcPattern *p)
{
e = FcPatternEltU(p->elts) + i;
printf ("\t%s:", FcObjectPtrU(e->object));
FcValueListPrint (e->values);
/* so that fc-match properly displays file: foo... */
if (e->object == FcObjectToPtr(FC_FILE))
{
FcChar8 * s;
FcPatternGetString (p, FC_FILE, 0, &s);
printf (" \"%s\"", s);
switch (FcValueListPtrU(e->values)->binding) {
case FcValueBindingWeak:
printf ("(w)");
break;
case FcValueBindingStrong:
printf ("(s)");
break;
case FcValueBindingSame:
printf ("(=)");
break;
}
}
else
FcValueListPrint (e->values);
printf ("\n");
}
printf ("\n");
......
......@@ -29,8 +29,11 @@
#include "fcint.h"
/* Please do not revoke any of these bindings. */
/* The __DUMMY__ object enables callers to distinguish the error return
* of FcObjectToPtrLookup from FC_FAMILY's FcObjectPtr, which would
* otherwise be 0. */
static const FcObjectType _FcBaseObjectTypes[] = {
{ "__DUMMY__", FcTypeVoid, },
{ "__DUMMY__", FcTypeVoid, },
{ FC_FAMILY, FcTypeString, },
{ FC_FAMILYLANG, FcTypeString, },
{ FC_STYLE, FcTypeString, },
......@@ -207,8 +210,8 @@ FcObjectToPtrLookup (const char * object)
}
}
/* We didn't match. Look for the correct FcObjectTypeList
* to replace it in-place. */
/* We didn't match. Look for the application's FcObjectTypeList
* and replace it in-place. */
for (l = _FcObjectTypes; l; l = l->next)
{
if (l->types == _FcUserObjectNames)
......@@ -703,7 +706,7 @@ FcNameParse (const FcChar8 *name)
for (;;)
{
name = FcNameFindNext (name, ":,", save, &delim);
if (t)
if (t && strcmp (t->object, _FcBaseObjectTypes[0].object))
{
v = FcNameConvert (t->type, save, &m);
if (!FcPatternAdd (pat, t->object, v, FcTrue))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment