From owner-dev-commits-src-main@freebsd.org Wed Dec 23 12:54:48 2020 Return-Path: Delivered-To: dev-commits-src-main@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 434294BEB99; Wed, 23 Dec 2020 12:54:48 +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 4D1Cpc0tl1z4qDH; Wed, 23 Dec 2020 12:54:48 +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 0D3FD1E4EC; Wed, 23 Dec 2020 12:54:48 +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 0BNCsl7k054941; Wed, 23 Dec 2020 12:54:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BNCsleA054940; Wed, 23 Dec 2020 12:54:47 GMT (envelope-from git) Date: Wed, 23 Dec 2020 12:54:47 GMT Message-Id: <202012231254.0BNCsleA054940@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Yuri Pankov Subject: git: f952bdf1425d - 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/main X-Git-Reftype: branch X-Git-Commit: f952bdf1425d6a877f99b5c5ca59f25fc8bedabe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 12:54:48 -0000 The branch main has been updated by yuripv: URL: https://cgit.FreeBSD.org/src/commit/?id=f952bdf1425d6a877f99b5c5ca59f25fc8bedabe commit f952bdf1425d6a877f99b5c5ca59f25fc8bedabe Author: Yuri Pankov AuthorDate: 2020-12-23 12:49:25 +0000 Commit: Yuri Pankov CommitDate: 2020-12-23 12:53:43 +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 --- 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;