aboutsummaryrefslogtreecommitdiff
path: root/tty.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2009-10-15 01:38:09 +0000
committerTiago Cunha <tcunha@gmx.com>2009-10-15 01:38:09 +0000
commit04db3c62114c3cc6a822e9045fe989d26d374016 (patch)
tree0bb5dd68d1c400f2ab074d98ac0ebfc6e4f98720 /tty.c
parent858b8b190b57da0105a48228ef9ede2f1d7562da (diff)
downloadrtmux-04db3c62114c3cc6a822e9045fe989d26d374016.tar.gz
rtmux-04db3c62114c3cc6a822e9045fe989d26d374016.tar.bz2
rtmux-04db3c62114c3cc6a822e9045fe989d26d374016.zip
Sync OpenBSD patchset 399:
Don't run through the column unchanged case if the row was unchanged but there were no suitable optimisations, instead make it an else to fall through to absolute addressing.
Diffstat (limited to 'tty.c')
-rw-r--r--tty.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/tty.c b/tty.c
index 3dd933ea..d82b117b 100644
--- a/tty.c
+++ b/tty.c
@@ -1,4 +1,4 @@
-/* $Id: tty.c,v 1.148 2009-10-15 01:36:53 tcunha Exp $ */
+/* $Id: tty.c,v 1.149 2009-10-15 01:38:09 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -973,8 +973,12 @@ tty_cursor(struct tty *tty, u_int cx, u_int cy)
goto out;
}
- /* Row staying the same. */
+ /* Moving column or row. */
if (cy == thisy) {
+ /*
+ * Moving column only, row staying the same.
+ */
+
/* To left edge. */
if (cx == 0) {
tty_putc(tty, '\r');
@@ -1010,10 +1014,11 @@ tty_cursor(struct tty *tty, u_int cx, u_int cy)
tty_putcode1(tty, TTYC_CUF, -change);
goto out;
}
- }
+ } else if (cx == thisx) {
+ /*
+ * Moving row only, column staying the same.
+ */
- /* Column staying the same. */
- if (cx == thisx ) {
/* One above. */
if (cy != tty->rupper &&
cy == thisy - 1 && tty_term_has(term, TTYC_CUU1)) {