https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298983

            Bug ID: 298983
           Summary: localedef(1) merges non-contiguous source characters
                    into one maplower/ mapupper range
           Product: Base System
           Version: Unspecified
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: [email protected]
          Reporter: [email protected]

Created attachment 275250
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=275250&action=edit
patches the issue described

localedef(1) merges non-contiguous source characters into one maplower/
mapupper range, giving wrong case mappings.

A range is looked up as target = map + c - min, so source and target must
both be contiguous.  The merge test only checks the target:

    } else if ((last_lo != NULL) &&
        (last_lo->tolower + 1 == ctn->tolower)) {

So a gap in the source merges entries with different deltas.  Greek
U+0387/U+038B/U+038D are not mapped, so U+0386..U+038A becomes one range:

    0x0386..0x038A -> 0x03AC..0x03B0    (should end at 0x03AF)

towlower(0x038A) gives 0x03B0 instead of 0x03AF.  Same for U+0388, U+0389,
U+038E, U+038F.

Fix: require the source to be contiguous too (last_lo->wc + 1 == wc), like
the runetype range above.  Same for toupper.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to