Sync OpenBSD patchset 1163:

Tidy up tty_write, from Sean Estabrooks.
This commit is contained in:
Tiago Cunha 2012-08-31 09:20:09 +00:00
parent 1c608031b5
commit 35690fb3a5

25
tty.c
View File

@ -667,7 +667,6 @@ tty_write(
{ {
struct window_pane *wp = ctx->wp; struct window_pane *wp = ctx->wp;
struct client *c; struct client *c;
struct session *s;
u_int i; u_int i;
/* wp can be NULL if updating the screen but not the terminal. */ /* wp can be NULL if updating the screen but not the terminal. */
@ -681,25 +680,19 @@ tty_write(
for (i = 0; i < ARRAY_LENGTH(&clients); i++) { for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
c = ARRAY_ITEM(&clients, i); c = ARRAY_ITEM(&clients, i);
if (c == NULL || c->session == NULL) if (c == NULL || c->session == NULL || c->tty.term == NULL)
continue; continue;
if (c->flags & CLIENT_SUSPENDED) if (c->flags & (CLIENT_SUSPENDED|TTY_FREEZE))
continue;
if (c->session->curw->window != wp->window)
continue; continue;
s = c->session;
if (s->curw->window == wp->window) { ctx->xoff = wp->xoff;
if (c->tty.term == NULL) ctx->yoff = wp->yoff;
continue; if (status_at_line(c) == 0)
if (c->tty.flags & TTY_FREEZE) ctx->yoff++;
continue;
ctx->xoff = wp->xoff; cmdfn(&c->tty, ctx);
ctx->yoff = wp->yoff;
if (status_at_line(c) == 0)
ctx->yoff++;
cmdfn(&c->tty, ctx);
}
} }
} }