From owner-svn-src-head@FreeBSD.ORG Thu Feb 6 12:24:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0167851D; Thu, 6 Feb 2014 12:24:59 +0000 (UTC) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.81]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AB8421D9F; Thu, 6 Feb 2014 12:24:57 +0000 (UTC) Received: from smtp.greenhost.nl ([213.108.104.138]) by smarthost1.greenhost.nl with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1WBO0l-0001xb-6P; Thu, 06 Feb 2014 13:24:55 +0100 Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "Aleksandr Rybalko" Subject: Re: svn commit: r261547 - head/sys/teken References: <201402061138.s16BceLv096268@svn.freebsd.org> Date: Thu, 06 Feb 2014 13:24:53 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Ronald Klop" Message-ID: In-Reply-To: <201402061138.s16BceLv096268@svn.freebsd.org> User-Agent: Opera Mail/12.16 (Win32) X-Authenticated-As-Hash: 398f5522cb258ce43cb679602f8cfe8b62a256d1 X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: / X-Spam-Score: 0.8 X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.1 X-Scan-Signature: 2c269fdec788119c0964d98755c55204 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 12:24:59 -0000 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? 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"