From owner-dev-commits-src-branches@freebsd.org Mon Dec 28 04:59:16 2020 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B6BA84D129F; Mon, 28 Dec 2020 04:59:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D451c4G1Vz4hKB; Mon, 28 Dec 2020 04:59:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8101313FF6; Mon, 28 Dec 2020 04:59:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BS4xG6u090339; Mon, 28 Dec 2020 04:59:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BS4xGIg090338; Mon, 28 Dec 2020 04:59:16 GMT (envelope-from git) Date: Mon, 28 Dec 2020 04:59:16 GMT Message-Id: <202012280459.0BS4xGIg090338@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Yuri Pankov Subject: git: 3cc3872829b1 - stable/12 - tools/tools/locale: skip control character widths MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuripv X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 3cc3872829b1852f3edea43f187c959fb264e95d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the stable branches of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2020 04:59:16 -0000 The branch stable/12 has been updated by yuripv: URL: https://cgit.FreeBSD.org/src/commit/?id=3cc3872829b1852f3edea43f187c959fb264e95d commit 3cc3872829b1852f3edea43f187c959fb264e95d Author: Yuri Pankov AuthorDate: 2020-12-23 12:49:25 +0000 Commit: Yuri Pankov CommitDate: 2020-12-28 04:58:51 +0000 tools/tools/locale: skip control character widths Do not explicitly encode control characters widths as 0 allowing wcwidth() to return the proper implicit value for non-printable characters (-1). Reported by: naddy (cherry picked from commit f952bdf1425d6a877f99b5c5ca59f25fc8bedabe) --- tools/tools/locale/etc/final-maps/widths.txt | 65 ---------------------------- tools/tools/locale/tools/getwidths.c | 4 ++ 2 files changed, 4 insertions(+), 65 deletions(-) diff --git a/tools/tools/locale/etc/final-maps/widths.txt b/tools/tools/locale/etc/final-maps/widths.txt index f01a4d5a0dd5..74c28ac58463 100644 --- a/tools/tools/locale/etc/final-maps/widths.txt +++ b/tools/tools/locale/etc/final-maps/widths.txt @@ -3,71 +3,6 @@ # utf8proc 2.5.0. # ----------------------------------------------------------------------------- WIDTH - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 0 0 0 diff --git a/tools/tools/locale/tools/getwidths.c b/tools/tools/locale/tools/getwidths.c index 670ebd957878..f1c7c6cc463d 100644 --- a/tools/tools/locale/tools/getwidths.c +++ b/tools/tools/locale/tools/getwidths.c @@ -35,12 +35,16 @@ main(void) { int32_t wc; int i, wcw; + utf8proc_category_t wcc; setlocale(LC_CTYPE, "C.UTF-8"); printf("%s\n", utf8proc_version()); for (wc = 0; wc < 0x110000; wc++) { + wcc = utf8proc_category(wc); + if (wcc == UTF8PROC_CATEGORY_CC) + continue; wcw = utf8proc_charwidth(wc); if (wcw == 1) continue;