localedef: Fix ctype dump (fixed wide spread errors)
commit1921e53878cbc1308c1de0c46e9b3fa5889b5791
authorJohn Marino <draco@marino.st>
Thu, 6 Oct 2016 15:37:06 +0000 (6 10:37 -0500)
committerLauri Tirkkonen <lotheac@iki.fi>
Tue, 28 Feb 2017 14:11:05 +0000 (28 16:11 +0200)
tree425cef670e6ec829623d715133aa53ae18d33f8b
parentae02e6f0284375789ff4e2ccc75792ddac480e33
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.

Imported from DragonFlyBSD by Lauri Tirkkonen <lotheac@iki.fi>
bin/localedef/ctype.c