Sync OpenBSD patchset 413:

When checking whether the region will scroll and the cursor position is thus
unsuitable for using CUD/CUU, check the current cursor position not the target
position.
This commit is contained in:
Tiago Cunha 2009-10-23 17:03:48 +00:00
parent 4afecbe400
commit 13d1df659f

6
tty.c
View File

@ -1,4 +1,4 @@
/* $Id: tty.c,v 1.152 2009-10-15 01:44:15 tcunha Exp $ */
/* $Id: tty.c,v 1.153 2009-10-23 17:03:48 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -1062,14 +1062,14 @@ tty_cursor(struct tty *tty, u_int cx, u_int cy)
*/
/* One above. */
if (cy != tty->rupper &&
if (thisy != tty->rupper &&
cy == thisy - 1 && tty_term_has(term, TTYC_CUU1)) {
tty_putcode(tty, TTYC_CUU1);
goto out;
}
/* One below. */
if (cy != tty->rlower &&
if (thisy != tty->rlower &&
cy == thisy + 1 && tty_term_has(term, TTYC_CUD1)) {
tty_putcode(tty, TTYC_CUD1);
goto out;