]> git.wh0rd.org - fontconfig.git/blobdiff - src/fccharset.c
Always set *changed in FcCharsetMerge
[fontconfig.git] / src / fccharset.c
index 2ec74da2893c9fca98442aafb33c8accb5247bb4..cba21c771f05a86a0a5f29c36759da972ca3583f 100644 (file)
@@ -143,12 +143,12 @@ FcCharSetPutLeaf (FcCharSet       *fcs,
     intptr_t   *leaves = FcCharSetLeaves (fcs);
     FcChar16   *numbers = FcCharSetNumbers (fcs);
 
+    /* XXX We can't handle Unicode values in Plane 16 */
     ucs4 >>= 8;
     if (ucs4 >= 0x10000)
        return FcFalse;
-    if (!fcs->num)
-       leaves = malloc (sizeof (*leaves));
-    else
+
+    if (fcs->num == fcs->alloced)
     {
        intptr_t    *new_leaves = realloc (leaves, (fcs->num + 1) * 
                                           sizeof (*leaves));
@@ -470,8 +470,11 @@ FcCharSetMerge (FcCharSet *a, const FcCharSet *b, FcBool *changed)
     int                ai = 0, bi = 0;
     FcChar16   an, bn;
 
-    if (a->ref == FC_REF_CONSTANT)
+    if (a->ref == FC_REF_CONSTANT) {
+       if (changed)
+           *changed = FcFalse;
        return FcFalse;
+    }
 
     if (changed) {
        *changed = !FcCharSetIsSubset(b, a);