localedef: Fix ctype dump (fixed wide spread errors)
authorJohn Marino <draco@marino.st>
Thu, 6 Oct 2016 15:37:06 +0000 (10:37 -0500)
committerJohn Marino <draco@marino.st>
Thu, 6 Oct 2016 17:26:19 +0000 (12:26 -0500)
commit07ed7d329a83714ec268e2f3ce026bba5a1ac5c2
treed9f10941435fc399769b6e22c92eef431aa66e2e
parent89f579e9823a5c446ca172cf82bbc210d6a054a4
localedef: Fix ctype dump (fixed wide spread errors)

This was a CTYPE encoding error involving consecutive points of the same
ctype.  It was reported by myself to Illumos over a year ago but I was
unsure if it was only happening on BSD.  Given the cause, the bug is also
present on Illumos.

Basically, if consecutive points were of the exact same ctype, they would
be defined as a range regardless.  For example, all of these would be
considered equivalent:

  <A> ... <C>, <H>  (converts to <A> .. <H>)
  <A>, <B>, <H>     (converts to <A> .. <H>)
  <A>, <J> ... <H>  (converts to <A> .. <H>)

So all the points that shouldn't have been defined got "bridged" by the
extreme points.

The effects were recently reported to FreeBSD on PR 213013.  There are
countless places were the ctype flags are misdefined, so this is a major
fix that has to be MFC'd.
usr.bin/localedef/ctype.c