localedef: Fix ctype dump (fixed wide spread errors)
authorbapt <bapt@FreeBSD.org>
Thu, 6 Oct 2016 19:46:43 +0000 (19:46 +0000)
committerbapt <bapt@FreeBSD.org>
Thu, 6 Oct 2016 19:46:43 +0000 (19:46 +0000)
commit618160147fb23e6de542cce94593fad8350ec183
tree2e6461731729457754602d58af3276757785fccd
parentfc32cf9f5037a197feef799e9b3dc4f5189ef383
localedef: Fix ctype dump (fixed wide spread errors)

This commit is from John Marino in dragonfly with the following commit log:

====
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.
====

This reveals a bad change I did on the testsuite: while 0x07FF is a valid
unicode it is not used yet (reserved for future use)

PR: 213013
Submitted by: marino@
Reported by: Kurtis Rader <krader@skepticism.us>
Obtained from: Dragonfly
MFC after: 1 month
contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c
usr.bin/localedef/ctype.c