Fix lang matching logic

Previous code was broken logically, but harmless.
This commit is contained in:
Behdad Esfahbod committed 2014-07-10 19:20:35 -04:00
1 parent ee5350d667
commit f381e320df
2 files changed
+2 -1

No files matched your search

+1 -1
View File
@@ -845,7 +845,7 @@ hb_ot_tag_from_language (hb_language_t language)
{
const LangTagLong *lang_tag;
lang_tag = &ot_languages_zh[i];
if (lang_matches (lang_tag->language, lang_str))
if (lang_matches (lang_str, lang_tag->language))
return lang_tag->tag;
}
+1
View File
@@ -195,6 +195,7 @@ test_ot_tag_language (void)
test_language_two_way ("ZHH", "zh-hk"); /* Chinese (Hong Kong) */
test_tag_from_language ("ZHS", "zh"); /* Chinese */
test_tag_from_language ("ZHS", "zh-cn"); /* Chinese (China) */
test_tag_from_language ("ZHS", "zh-sg"); /* Chinese (Singapore) */
test_tag_from_language ("ZHT", "zh-mo"); /* Chinese (Macao) */