From: Keith Packard Date: Thu, 7 Sep 2006 00:45:40 +0000 (-0700) Subject: Charset hashing depended on uniqueness of leaves. X-Git-Tag: 2.3.97~1 X-Git-Url: https://git.wh0rd.org/?p=fontconfig.git;a=commitdiff_plain;h=c3796ac6061373bcf0276a931036987c01741215 Charset hashing depended on uniqueness of leaves. Charset hashing actually use the value of the leaf pointers, which is clearly wrong, especially now that charsets are not shared across multiple font directories. --- diff --git a/src/fccharset.c b/src/fccharset.c index 1c2e2ea..5da1312 100644 --- a/src/fccharset.c +++ b/src/fccharset.c @@ -1064,8 +1064,8 @@ FcCharSetHash (FcCharSet *fcs) int i; /* hash in leaves */ - for (i = 0; i < fcs->num * (int) (sizeof (FcCharLeaf *) / sizeof (FcChar32)); i++) - hash = ((hash << 1) | (hash >> 31)) ^ (FcChar32)(FcCharSetLeaf(fcs, i)->map); + for (i = 0; i < fcs->num; i++) + hash = ((hash << 1) | (hash >> 31)) ^ FcCharLeafHash (FcCharSetLeaf(fcs,i)); /* hash in numbers */ for (i = 0; i < fcs->num; i++) hash = ((hash << 1) | (hash >> 31)) ^ *FcCharSetNumbers(fcs);