From owner-svn-src-stable@freebsd.org Mon Apr 9 12:58:57 2018 Return-Path: Delivered-To: svn-src-stable@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 92889FA25ED; Mon, 9 Apr 2018 12:58:57 +0000 (UTC) (envelope-from emaste@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 8C12B69FD1; Mon, 9 Apr 2018 12:58:54 +0000 (UTC) (envelope-from emaste@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 E1C1F1EF55; Mon, 9 Apr 2018 12:58:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w39Cwro7014350; Mon, 9 Apr 2018 12:58:53 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39Cwr3p014349; Mon, 9 Apr 2018 12:58:53 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804091258.w39Cwr3p014349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Apr 2018 12:58:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332323 - stable/10/usr.bin/vtfontcvt X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/10/usr.bin/vtfontcvt X-SVN-Commit-Revision: 332323 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 12:58:57 -0000 Author: emaste Date: Mon Apr 9 12:58:53 2018 New Revision: 332323 URL: https://svnweb.freebsd.org/changeset/base/332323 Log: MFC r296920: vtfontcvt: support .hex fonts with chars beyond Unicode BMP This is already supported by the vt(4) vfnt format mapping from code points to glyphs. Update the .hex font parser to accept up to six hex digits. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.bin/vtfontcvt/vtfontcvt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- stable/10/usr.bin/vtfontcvt/vtfontcvt.c Mon Apr 9 12:57:08 2018 (r332322) +++ stable/10/usr.bin/vtfontcvt/vtfontcvt.c Mon Apr 9 12:58:53 2018 (r332323) @@ -328,12 +328,13 @@ parse_hex(FILE *fp, unsigned int map_idx) if (bytes != NULL) errx(1, "malformed input: Width tag after font data"); set_width(atoi(ln + 9)); - } else if (sscanf(ln, "%4x:", &curchar)) { + } else if (sscanf(ln, "%6x:", &curchar)) { if (bytes == NULL) { bytes = xmalloc(wbytes * height); bytes_r = xmalloc(wbytes * height); } - p = ln + 5; + /* ln is guaranteed to have a colon here. */ + p = strchr(ln, ':') + 1; chars_per_row = strlen(p) / height; dwidth = width; if (chars_per_row / 2 > (width + 7) / 8)