From owner-svn-src-all@freebsd.org Tue Dec 6 00:09:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32653C69B6B; Tue, 6 Dec 2016 00:09:54 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D35D968; Tue, 6 Dec 2016 00:09:53 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB609rPi062890; Tue, 6 Dec 2016 00:09:53 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB609qD0062887; Tue, 6 Dec 2016 00:09:52 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201612060009.uB609qD0062887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 6 Dec 2016 00:09:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r309584 - in releng/11.0: contrib/netbsd-tests/lib/libc/locale usr.bin/localedef X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 00:09:54 -0000 Author: glebius Date: Tue Dec 6 00:09:52 2016 New Revision: 309584 URL: https://svnweb.freebsd.org/changeset/base/309584 Log: 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 Modified: releng/11.0/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c releng/11.0/usr.bin/localedef/ctype.c releng/11.0/usr.bin/localedef/parser.y (contents, props changed) Directory Properties: releng/11.0/ (props changed) Modified: releng/11.0/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c ============================================================================== --- releng/11.0/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c Tue Dec 6 00:06:16 2016 (r309583) +++ releng/11.0/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c Tue Dec 6 00:09:52 2016 (r309584) @@ -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 Modified: releng/11.0/usr.bin/localedef/ctype.c ============================================================================== --- releng/11.0/usr.bin/localedef/ctype.c Tue Dec 6 00:06:16 2016 (r309583) +++ releng/11.0/usr.bin/localedef/ctype.c Tue Dec 6 00:09:52 2016 (r309584) @@ -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) && Modified: releng/11.0/usr.bin/localedef/parser.y ============================================================================== --- releng/11.0/usr.bin/localedef/parser.y Tue Dec 6 00:06:16 2016 (r309583) +++ releng/11.0/usr.bin/localedef/parser.y Tue Dec 6 00:09:52 2016 (r309584) @@ -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 +cc_range_end : T_ELLIPSIS T_SEMI T_CHAR { - add_ctype($3); + add_ctype_range($3); } - | cc_list T_SEMI T_SYMBOL - { - add_charmap_undefined($3); - } - | cc_list T_SEMI T_ELLIPSIS T_SEMI T_CHAR - { - /* note that the endpoints *must* be characters */ - add_ctype_range($5); - } - | T_CHAR + ; + +cc_char : T_CHAR { add_ctype($1); }