]> git.wh0rd.org - fontconfig.git/blobdiff - src/fclist.c
Don't change the order of names unnecessarily (#20128)
[fontconfig.git] / src / fclist.c
index 2a53b79866699fcd3632b6e650d94a8f7c804d58..d804c150386b5909c9853db9c2a88289c62df107 100644 (file)
@@ -13,9 +13,9 @@
  * representations about the suitability of this software for any purpose.  It
  * is provided "as is" without express or implied warranty.
  *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
@@ -350,7 +350,10 @@ FcGetDefaultObjectLangIndex (FcPattern *font, FcObject object)
            if (value.type == FcTypeString)
            {
                FcLangResult res = FcLangCompare (value.u.s, lang);
-               if (res == FcLangEqual || (res == FcLangDifferentCountry && idx < 0))
+               if (res == FcLangEqual)
+                   return i;
+
+               if (res == FcLangDifferentCountry && idx < 0)
                    idx = i;
            }
        }
@@ -555,6 +558,9 @@ FcFontList (FcConfig        *config,
 
     if (!config)
     {
+       if (!FcInitBringUptoDate ())
+           return 0;
+
        config = FcConfigGetCurrent ();
        if (!config)
            return 0;