Commit e117d676 authored by Matthias Clasen's avatar Matthias Clasen
Browse files

Fixup: Handle patterns without family

Pointed out by Akira Tagoh.
parent 51d40491
......@@ -525,25 +525,28 @@ FcCompareDataInit (FcPattern *pat,
free);
elt = FcPatternObjectFindElt (pat, FC_FAMILY_OBJECT);
for (l = FcPatternEltValues(elt), i = 0; l; l = FcValueListNext(l), i++)
if (elt)
{
key = FcValueString (&l->value);
if (!FcHashTableFind (table, key, (void **)&e))
for (l = FcPatternEltValues(elt), i = 0; l; l = FcValueListNext(l), i++)
{
e = malloc (sizeof (FamilyEntry));
e->strong_value = 1e99;
e->weak_value = 1e99;
FcHashTableAdd (table, (void *)key, e);
}
if (l->binding == FcValueBindingWeak)
{
if (i < e->weak_value)
e->weak_value = i;
}
else
{
if (i < e->strong_value)
e->strong_value = i;
key = FcValueString (&l->value);
if (!FcHashTableFind (table, key, (void **)&e))
{
e = malloc (sizeof (FamilyEntry));
e->strong_value = 1e99;
e->weak_value = 1e99;
FcHashTableAdd (table, (void *)key, e);
}
if (l->binding == FcValueBindingWeak)
{
if (i < e->weak_value)
e->weak_value = i;
}
else
{
if (i < e->strong_value)
e->strong_value = i;
}
}
}
......
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