From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 13:35:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5FC11F71; Thu, 6 Feb 2014 13:35:09 +0000 (UTC) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id 17B4D15CC; Thu, 6 Feb 2014 13:35:08 +0000 (UTC) Received: from terran (unknown [192.168.99.1]) (Authenticated sender: ray) by smtp.dlink.ua (Postfix) with ESMTPA id 23A92C497E; Thu, 6 Feb 2014 15:29:09 +0200 (EET) Date: Thu, 6 Feb 2014 15:32:29 +0200 From: Aleksandr Rybalko To: "Ronald Klop" Subject: Re: svn commit: r261547 - head/sys/teken Message-Id: <20140206153229.1afa30afc5c7ccec45adde86@freebsd.org> In-Reply-To: References: <201402061138.s16BceLv096268@svn.freebsd.org> X-Mailer: Sylpheed 3.2.0 (GTK+ 2.24.6; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 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: Thu, 06 Feb 2014 13:35:09 -0000 On Thu, 06 Feb 2014 13:24:53 +0100 "Ronald Klop" wrote: > On Thu, 06 Feb 2014 12:38:40 +0100, Aleksandr Rybalko > wrote: > > > Author: ray > > Date: Thu Feb 6 11:38:39 2014 > > New Revision: 261547 > > URL: http://svnweb.freebsd.org/changeset/base/261547 > > > > Log: > > Fix crash on load of bigger font. It reduce width and height of > > terminal, but > > current cursor position stay bigger that terminal window size, so next > > input > > triggers assert. > > Reported by: emaste > > Sponsored by: The FreeBSD Foundation > > > > Modified: > > head/sys/teken/teken.c > > > > Modified: head/sys/teken/teken.c > > ============================================================================== > > --- head/sys/teken/teken.c Thu Feb 6 10:52:51 2014 (r261546) > > +++ head/sys/teken/teken.c Thu Feb 6 11:38:39 2014 (r261547) > > @@ -338,10 +338,26 @@ teken_get_winsize(teken_t *t) > > return (&t->t_winsize); > > } > > +static void > > +taken_trim_cursor_pos(teken_t *t, const teken_pos_t *new) > > Was teken... already taken? Oops. it is almost taken :) Fixed in r261551. Thanks Ronald! > > > Ronald. > > > > +{ > > + const teken_pos_t *cur; > > + > > + cur = &t->t_winsize; > > + > > + if (cur->tp_row < new->tp_row || cur->tp_col < new->tp_col) > > + return; > > + if (t->t_cursor.tp_row >= new->tp_row) > > + t->t_cursor.tp_row = new->tp_row - 1; > > + if (t->t_cursor.tp_col >= new->tp_col) > > + t->t_cursor.tp_col = new->tp_col - 1; > > +} > > + > > void > > teken_set_winsize(teken_t *t, const teken_pos_t *p) > > { > > + taken_trim_cursor_pos(t, p); > > t->t_winsize = *p; > > teken_subr_do_reset(t); > > } > > @@ -350,6 +366,7 @@ void > > teken_set_winsize_noreset(teken_t *t, const teken_pos_t *p) > > { > > + taken_trim_cursor_pos(t, p); > > t->t_winsize = *p; > > teken_subr_do_resize(t); > > } > > _______________________________________________ > > svn-src-all@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/svn-src-all > > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" WBW -- Aleksandr Rybalko