From owner-svn-src-all@freebsd.org Thu Dec 6 11:52:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBB1C1329369; Thu, 6 Dec 2018 11:52:08 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 737828DAB6; Thu, 6 Dec 2018 11:52:08 +0000 (UTC) (envelope-from yuripv@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55BE023249; Thu, 6 Dec 2018 11:52:08 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB6Bq8iV077397; Thu, 6 Dec 2018 11:52:08 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB6Bq8fu077396; Thu, 6 Dec 2018 11:52:08 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201812061152.wB6Bq8fu077396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Thu, 6 Dec 2018 11:52:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r341631 - stable/11/usr.bin/localedef X-SVN-Group: stable-11 X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: stable/11/usr.bin/localedef X-SVN-Commit-Revision: 341631 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 737828DAB6 X-Spamd-Result: default: False [-1.18 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.48)[-0.477,0]; NEURAL_HAM_SHORT(-0.60)[-0.599,0]; NEURAL_HAM_LONG(-0.10)[-0.099,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 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: Thu, 06 Dec 2018 11:52:09 -0000 Author: yuripv Date: Thu Dec 6 11:52:07 2018 New Revision: 341631 URL: https://svnweb.freebsd.org/changeset/base/341631 Log: MFC r339827: localedef: define characters in "space" class also as "print", except for the known conflicts ("control" characters can't be "print"able). POSIX doesn't explicitly forbid this, and actually includes character in "print". PR: 225692 Reviewed by: bapt, cem (previous version), pfg (previous version) Differential Revision: https://reviews.freebsd.org/D17467 Modified: stable/11/usr.bin/localedef/ctype.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/localedef/ctype.c ============================================================================== --- stable/11/usr.bin/localedef/ctype.c Thu Dec 6 11:49:52 2018 (r341630) +++ stable/11/usr.bin/localedef/ctype.c Thu Dec 6 11:52:07 2018 (r341631) @@ -120,7 +120,13 @@ add_ctype_impl(ctype_node_t *ctn) ctn->ctype |= (_ISDIGIT | _ISGRAPH | _ISPRINT | _ISXDIGIT | _E4); break; case T_ISSPACE: - ctn->ctype |= _ISSPACE; + /* + * This can be troublesome as , , + * , , and are defined both + * as space and cntrl, and POSIX doesn't allow cntrl/print + * combination. We will take care of this in dump_ctype(). + */ + ctn->ctype |= (_ISSPACE | _ISPRINT); break; case T_ISCNTRL: ctn->ctype |= _ISCNTRL; @@ -372,9 +378,15 @@ dump_ctype(void) ctn->ctype |= _ISPRINT; /* - * Finally, POSIX requires that certain combinations - * are invalid. We don't flag this as a fatal error, - * but we will warn about. + * POSIX requires that certain combinations are invalid. + * Try fixing the cases we know about (see add_ctype_impl()). + */ + if ((ctn->ctype & (_ISSPACE|_ISCNTRL)) == (_ISSPACE|_ISCNTRL)) + ctn->ctype &= ~_ISPRINT; + + /* + * Finally, don't flag remaining cases as a fatal error, + * and just warn about them. */ if ((ctn->ctype & _ISALPHA) && (ctn->ctype & (_ISPUNCT|_ISDIGIT)))