From 231c19b1e3110db8de2b5f349758a1f3c204fea4 Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Mon, 10 Oct 2011 06:13:27 +0000 Subject: [PATCH] Properly use the cursor to bound the position for CUP. We must take the origin region into account when clamping the cursor position. MFC after: 3 days --- sys/teken/teken_subr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/teken/teken_subr.h b/sys/teken/teken_subr.h index af70a00d041..64f4e5456bf 100644 --- a/sys/teken/teken_subr.h +++ b/sys/teken/teken_subr.h @@ -325,7 +325,7 @@ teken_subr_cursor_position(teken_t *t, unsigned int row, unsigned int col) { t->t_cursor.tp_row = t->t_originreg.ts_begin + row - 1; - if (row >= t->t_originreg.ts_end) + if (t->t_cursor.tp_row >= t->t_originreg.ts_end) t->t_cursor.tp_row = t->t_originreg.ts_end - 1; t->t_cursor.tp_col = col - 1;