diff options
author | Gleb Smirnoff <glebius@FreeBSD.org> | 2016-12-06 00:09:52 +0000 |
---|---|---|
committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2016-12-06 00:09:52 +0000 |
commit | 25aff0f987af341b76a60374cc9f46bc315105bb (patch) | |
tree | 99963a8bb6d0d4dc057ad1ef411b871a3ce4a03a | |
parent | 0497163ea398f0420d3d19dd137349772a0e7fff (diff) |
Merge r308330 by bapt:
localedef: Fix ctype dump (fixed wide spread errors)
See original commit for longer description.
Errata Notice: EN-16:21
Approved by: so
Notes
Notes:
svn path=/releng/11.0/; revision=309584
-rw-r--r-- | contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c | 2 | ||||
-rw-r--r-- | usr.bin/localedef/ctype.c | 6 | ||||
-rw-r--r-- | usr.bin/localedef/parser.y | 23 |
3 files changed, 15 insertions, 16 deletions
diff --git a/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c b/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c index 0c443169362b..716a881a6946 100644 --- a/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c +++ b/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c @@ -88,7 +88,7 @@ static struct test { 0xFFFF, 0x5D, 0x5B, 0x10000, 0x10FFFF, 0x5D, 0x0A }, #ifdef __FreeBSD__ - { 1, -1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, + { 1, -1, -1, 1, 1, -1, -1, 1, 1, 1, -1, 1, 1, -1, -1, #else { 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, #endif diff --git a/usr.bin/localedef/ctype.c b/usr.bin/localedef/ctype.c index e737ed5f876b..0e238d79080f 100644 --- a/usr.bin/localedef/ctype.c +++ b/usr.bin/localedef/ctype.c @@ -407,9 +407,9 @@ dump_ctype(void) continue; } - if ((last_ct != NULL) && (last_ct->ctype == ctn->ctype)) { + if ((last_ct != NULL) && (last_ct->ctype == ctn->ctype) && + (last_ct->wc + 1 == wc)) { ct[rl.runetype_ext_nranges-1].max = wc; - last_ct = ctn; } else { rl.runetype_ext_nranges++; ct = realloc(ct, @@ -417,8 +417,8 @@ dump_ctype(void) ct[rl.runetype_ext_nranges - 1].min = wc; ct[rl.runetype_ext_nranges - 1].max = wc; ct[rl.runetype_ext_nranges - 1].map = ctn->ctype; - last_ct = ctn; } + last_ct = ctn; if (ctn->tolower == 0) { last_lo = NULL; } else if ((last_lo != NULL) && diff --git a/usr.bin/localedef/parser.y b/usr.bin/localedef/parser.y index 87ff95d5e956..73bc6f902f39 100644 --- a/usr.bin/localedef/parser.y +++ b/usr.bin/localedef/parser.y @@ -27,6 +27,8 @@ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ */ /* @@ -321,21 +323,18 @@ ctype_kw : T_ISUPPER cc_list T_NL | T_TOLOWER conv_list T_NL ; +cc_list : cc_list T_SEMI cc_range_end + | cc_list T_SEMI cc_char + | cc_char + ; -cc_list : cc_list T_SEMI T_CHAR - { - add_ctype($3); - } - | cc_list T_SEMI T_SYMBOL - { - add_charmap_undefined($3); - } - | cc_list T_SEMI T_ELLIPSIS T_SEMI T_CHAR +cc_range_end : T_ELLIPSIS T_SEMI T_CHAR { - /* note that the endpoints *must* be characters */ - add_ctype_range($5); + add_ctype_range($3); } - | T_CHAR + ; + +cc_char : T_CHAR { add_ctype($1); } |