From owner-svn-src-head@freebsd.org Sun Oct 21 08:29:38 2018 Return-Path: Delivered-To: svn-src-head@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 ED862FE4733; Sun, 21 Oct 2018 08:29:37 +0000 (UTC) (envelope-from phk@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 9E87482001; Sun, 21 Oct 2018 08:29:37 +0000 (UTC) (envelope-from phk@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 975802CF0; Sun, 21 Oct 2018 08:29:37 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9L8TbgE077784; Sun, 21 Oct 2018 08:29:37 GMT (envelope-from phk@FreeBSD.org) Received: (from phk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9L8Tapm077781; Sun, 21 Oct 2018 08:29:36 GMT (envelope-from phk@FreeBSD.org) Message-Id: <201810210829.w9L8Tapm077781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phk set sender to phk@FreeBSD.org using -f From: Poul-Henning Kamp Date: Sun, 21 Oct 2018 08:29:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339529 - head/sys/teken X-SVN-Group: head X-SVN-Commit-Author: phk X-SVN-Commit-Paths: head/sys/teken X-SVN-Commit-Revision: 339529 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Oct 2018 08:29:38 -0000 Author: phk Date: Sun Oct 21 08:29:36 2018 New Revision: 339529 URL: https://svnweb.freebsd.org/changeset/base/339529 Log: Implement ECMA-48 "REP", some Linuxen have started emitting them recently. Approved by: ed Modified: head/sys/teken/gensequences head/sys/teken/sequences head/sys/teken/teken.h head/sys/teken/teken_subr.h Modified: head/sys/teken/gensequences ============================================================================== --- head/sys/teken/gensequences Sun Oct 21 07:56:58 2018 (r339528) +++ head/sys/teken/gensequences Sun Oct 21 08:29:36 2018 (r339529) @@ -158,6 +158,7 @@ for (p in l_prefix_name) { if (l_prefix_name[p] != "teken_state_init") { print ""; + print "\tt->t_last = 0;"; print "\tteken_state_switch(t, teken_state_init);"; } print "}"; Modified: head/sys/teken/sequences ============================================================================== --- head/sys/teken/sequences Sun Oct 21 07:56:58 2018 (r339528) +++ head/sys/teken/sequences Sun Oct 21 08:29:36 2018 (r339529) @@ -114,3 +114,6 @@ C25VTSW Cons25 switch virtual terminal ^[ [ z r # VT52 compatibility #DECID VT52 DECID ^[ Z + +# ECMA-48 +REP Repeat last graphic char ^[ [ b n Modified: head/sys/teken/teken.h ============================================================================== --- head/sys/teken/teken.h Sun Oct 21 07:56:58 2018 (r339528) +++ head/sys/teken/teken.h Sun Oct 21 08:29:36 2018 (r339529) @@ -157,6 +157,7 @@ struct __teken { unsigned int t_utf8_left; teken_char_t t_utf8_partial; + teken_char_t t_last; unsigned int t_curscs; teken_scs_t *t_saved_curscs; Modified: head/sys/teken/teken_subr.h ============================================================================== --- head/sys/teken/teken_subr.h Sun Oct 21 07:56:58 2018 (r339528) +++ head/sys/teken/teken_subr.h Sun Oct 21 08:29:36 2018 (r339529) @@ -796,10 +796,11 @@ teken_subr_primary_device_attributes(const teken_t *t, } static void -teken_subr_do_putchar(const teken_t *t, const teken_pos_t *tp, teken_char_t c, +teken_subr_do_putchar(teken_t *t, const teken_pos_t *tp, teken_char_t c, int width) { + t->t_last = c; if (t->t_stateflags & TS_INSERT && tp->tp_col < t->t_winsize.tp_col - width) { teken_rect_t ctr; @@ -1332,3 +1333,12 @@ teken_subr_vertical_position_absolute(teken_t *t, unsi t->t_stateflags &= ~TS_WRAPPED; teken_funcs_cursor(t); } + +static void +teken_subr_repeat_last_graphic_char(teken_t *t, unsigned int rpts) +{ + + for (; t->t_last != 0 && rpts > 0; rpts--) + teken_subr_regular_character(t, t->t_last); +} +