Commit 25a09eb9 authored by Behdad Esfahbod's avatar Behdad Esfahbod

Don't use FcCharSetCopy in FcCharSetMerge

The Copy function is actually a ref, not real copy.
parent d230cf14
......@@ -104,7 +104,7 @@ Returns a set including only those chars found in <parameter>a</parameter> but n
@TYPE2@ const FcCharSet * @ARG2@ b
@PURPOSE@ Merge charsets
@DESC@
If <parameter>a</parameter> is NULL, returns a copy of <parameter>b</parameter>.
If <parameter>a</parameter> is NULL, returns a newly-created copy of <parameter>b</parameter>.
If <parameter>a</parameter> is an FcCharSet object owned by fontconfig that
cannot be modified, it returns the union of <parameter>a</parameter> and
<parameter>b</parameter> in a newly-created FcCharSet object.
......
......@@ -459,14 +459,15 @@ FcCharSetMerge (FcCharSet *a, const FcCharSet *b)
FcCharSetIter ai, bi;
if (a == NULL) {
return FcCharSetCopy ((FcCharSet *) b);
fcs = a = FcCharSetCreate ();
} else if (a->ref == FC_REF_CONSTANT) {
fcs = FcCharSetCreate ();
if (fcs == NULL)
return NULL;
} else
fcs = a;
if (fcs == NULL)
return NULL;
FcCharSetIterStart (a, &ai);
FcCharSetIterStart (b, &bi);
while (ai.leaf || bi.leaf)
......
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