]> git.wh0rd.org - fontconfig.git/commitdiff
FcLangSetHasLang was not actually checking the language set itself
authorKeith Packard <keithp@keithp.com>
Mon, 26 Aug 2002 23:34:31 +0000 (23:34 +0000)
committerKeith Packard <keithp@keithp.com>
Mon, 26 Aug 2002 23:34:31 +0000 (23:34 +0000)
ChangeLog
src/fclang.c

index 710ef71dd0920725675b242e3fb01a3b9cfbd5c6..285c5a20c4c37fc620e1c13ecffb68a8e6bc1937 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Mon Aug 26 16:33:04 PDT 2002   keithp
+       + Owen discovered that FcLangSetHasLang wasn't actuall
+         checking the language set.
+
 Mon Aug 26 13:37:23 PDT 2002   keithp
        + Append a version number to cache filenames
 
index 1039b4b1ad4dc166ade45c291575d250f01ba09e..9852ea28bf58c23b21e66d90897982ef0f9feb0a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $XFree86: xc/lib/fontconfig/src/fclang.c,v 1.4 2002/07/12 21:06:03 keithp Exp $
+ * $XFree86: xc/lib/fontconfig/src/fclang.c,v 1.6 2002/08/22 18:53:22 keithp Exp $
  *
  * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc.
  *
@@ -275,9 +275,10 @@ FcLangSetHasLang (const FcLangSet *ls, const FcChar8 *lang)
     int                    i;
 
     id = FcLangSetIndex (lang);
-    if (id >= 0)
+    if (id < 0)
+       id = -id - 1;
+    else if (FcLangSetBitGet (ls, id))
        return FcLangEqual;
-    id = -id - 1;
     best = FcLangDifferentLang;
     for (i = id - 1; i >= 0; i--)
     {