Skip to content
  • Florent Rougon's avatar
    fc-lang: gracefully handle the case where the last language initial is < 'z' · 02161ef2
    Florent Rougon authored and Akira TAGOH's avatar Akira TAGOH committed
    FcLangSetIndex() contains code like this:
    
      low = fcLangCharSetRanges[firstChar - 'a'].begin;
      high = fcLangCharSetRanges[firstChar - 'a'].end;
      /* no matches */
      if (low > high)
    
    The assumption behind this test didn't hold before this commit, unless
    there is at least one language name that starts with 'z' (which is
    thankfully the case in our world :-). If the last language name in
    lexicographic order starts for instance with 'x', this change ensures
    that fcLangCharSetRanges['y' - 'a'].begin and
         fcLangCharSetRanges['z' - 'a'].begin
    are equal to NUM_LANG_CHAR_SET, in order to make the above assumption
    correct in all cases.
    02161ef2