Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 06 Feb 2014 13:24:53 +0100
From:      "Ronald Klop" <ronald-lists@klop.ws>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "Aleksandr Rybalko" <ray@freebsd.org>
Subject:   Re: svn commit: r261547 - head/sys/teken
Message-ID:  <op.xau0rrfkkndu52@ronaldradial.radialsg.local>
In-Reply-To: <201402061138.s16BceLv096268@svn.freebsd.org>
References:  <201402061138.s16BceLv096268@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 06 Feb 2014 12:38:40 +0100, Aleksandr Rybalko <ray@freebsd.org>  
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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?op.xau0rrfkkndu52>