Bug 101351 - FcLangSetCompare() gives an incorrect result when two charsets come from different "buckets" of fcLangCountrySets
Summary: FcLangSetCompare() gives an incorrect result when two charsets come from diff...
Status: RESOLVED FIXED
Alias: None
Product: fontconfig
Classification: Unclassified
Component: library (show other bugs)
Version: 2.12
Hardware: All All
: medium normal
Assignee: fontconfig-bugs
QA Contact: Behdad Esfahbod
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-08 14:07 UTC by Florent Rougon
Modified: 2017-06-12 05:28 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Commit (as output by 'git format-patch') (1.99 KB, patch)
2017-06-08 14:07 UTC, Florent Rougon
Details | Splinter Review

Description Florent Rougon 2017-06-08 14:07:49 UTC
Created attachment 131804 [details] [review]
Commit (as output by 'git format-patch')

As written at: https://lists.freedesktop.org/archives/fontconfig/2017-June/005944.html

In fcLangCountrySets, it may happen that two charsets for the same
language but different territories are found in different FcChar32
"buckets" (different "columns" on the same line). This is currently the
case for the following pairs:

  mn-cn  and mn-mn
  pap-an and pap-aw

The FcLangSetCompare() code in current 'master' returns
FcLangDifferentLang instead of FcLangDifferentTerritory when
comparing:

  an FcLangSet containing only mn-cn with one containing only mn-mn

or

  an FcLangSet containing only pap-an with one containing only pap-aw

The attached patch fixes this problem.
Comment 1 Akira TAGOH 2017-06-12 05:28:24 UTC
Thanks. merged and added a testcase for this.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.