summaryrefslogtreecommitdiff
path: root/src/fclang.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2009-07-22 19:25:24 -0400
committerBehdad Esfahbod <behdad@behdad.org>2009-07-22 19:25:24 -0400
commit5c6d1ff23bda4386984a1d6e4c024958f8f5547c (patch)
treeb7aa8e3893d204ec6dd21a4167c6a35a3f8e3a23 /src/fclang.c
parentd9741a7f1a73f718ab20b0582fff8aebeba01077 (diff)
downloadfontconfig-5c6d1ff23bda4386984a1d6e4c024958f8f5547c.tar.gz
Fix FcNameUnparseLangSet()
Was broken since ffd6668b469508177c4baf7745ae42aee5b00322
Diffstat (limited to 'src/fclang.c')
-rw-r--r--src/fclang.c29
1 files changed, 11 insertions, 18 deletions
diff --git a/src/fclang.c b/src/fclang.c
index fe4674c..9d1858d 100644
--- a/src/fclang.c
+++ b/src/fclang.c
@@ -551,27 +551,20 @@ bail0:
FcBool
FcNameUnparseLangSet (FcStrBuf *buf, const FcLangSet *ls)
{
- int i, bit;
- FcChar32 bits;
+ int i;
FcBool first = FcTrue;
- for (i = 0; i < NUM_LANG_SET_MAP; i++)
- {
- if ((bits = ls->map[i]))
- {
- for (bit = 0; bit <= 31; bit++)
- if (bits & (1 << bit))
- {
- int id = (i << 5) | bit;
- if (!first)
- if (!FcStrBufChar (buf, '|'))
- return FcFalse;
- if (!FcStrBufString (buf, fcLangCharSets[id].lang))
+ for (i = 0; i < NUM_LANG_CHAR_SET; i++)
+ if (FcLangSetBitGet (ls, i))
+ {
+ if (!first)
+ if (!FcStrBufChar (buf, '|'))
return FcFalse;
- first = FcFalse;
- }
- }
- }
+ if (!FcStrBufString (buf, fcLangCharSets[i].lang))
+ return FcFalse;
+ first = FcFalse;
+ }
+
if (ls->extra)
{
FcStrList *list = FcStrListCreate (ls->extra);