=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/tty.c,v retrieving revision 1.256 retrieving revision 1.257 diff -c -r1.256 -r1.257 *** src/usr.bin/tmux/tty.c 2017/03/24 14:45:00 1.256 --- src/usr.bin/tmux/tty.c 2017/04/05 10:45:20 1.257 *************** *** 1,4 **** ! /* $OpenBSD: tty.c,v 1.256 2017/03/24 14:45:00 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: tty.c,v 1.257 2017/04/05 10:45:20 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 602,609 **** static void tty_repeat_space(struct tty *tty, u_int n) { ! while (n-- > 0) ! tty_putc(tty, ' '); } /* --- 602,618 ---- static void tty_repeat_space(struct tty *tty, u_int n) { ! static char s[500]; ! ! if (*s != ' ') ! memset(s, ' ', sizeof s); ! ! while (n > sizeof s) { ! tty_putn(tty, s, sizeof s, sizeof s); ! n -= sizeof s; ! } ! if (n != 0) ! tty_putn(tty, s, n, n); } /* *************** *** 856,863 **** void tty_cmd_clearcharacter(struct tty *tty, const struct tty_ctx *ctx) { - u_int i; - tty_attributes(tty, &grid_default_cell, ctx->wp); tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy); --- 865,870 ---- *************** *** 865,874 **** if (tty_term_has(tty->term, TTYC_ECH) && !tty_fake_bce(tty, ctx->wp, ctx->bg)) tty_putcode1(tty, TTYC_ECH, ctx->num); ! else { ! for (i = 0; i < ctx->num; i++) ! tty_putc(tty, ' '); ! } } void --- 872,879 ---- if (tty_term_has(tty->term, TTYC_ECH) && !tty_fake_bce(tty, ctx->wp, ctx->bg)) tty_putcode1(tty, TTYC_ECH, ctx->num); ! else ! tty_repeat_space(tty, ctx->num); } void