diff options
author | 2009-11-18 17:02:17 +0000 | |
---|---|---|
committer | 2009-11-18 17:02:17 +0000 | |
commit | cb1fe32b53dde477c7e9087195a8f77403d032d0 (patch) | |
tree | ce342e4d3548a17182ce517e9fb95f658bfe17e5 /usr.bin/tmux/tty.c | |
parent | Add a per-client log of status line messages displayed while that client (diff) | |
download | wireguard-openbsd-cb1fe32b53dde477c7e9087195a8f77403d032d0.tar.xz wireguard-openbsd-cb1fe32b53dde477c7e9087195a8f77403d032d0.zip |
Cleanup by moving various (mostly horrible) little bits handling UTF-8 grid
data into functions in a new file, grid-utf8.c, and use sizeof intead of
UTF8_DATA.
Also nuke trailing whitespace from tmux.1, reminded by jmc.
Diffstat (limited to 'usr.bin/tmux/tty.c')
-rw-r--r-- | usr.bin/tmux/tty.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c index 8ef8bff1aad..c7dd4bc8fd7 100644 --- a/usr.bin/tmux/tty.c +++ b/usr.bin/tmux/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.70 2009/11/12 08:05:23 nicm Exp $ */ +/* $OpenBSD: tty.c,v 1.71 2009/11/18 17:02:17 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -365,16 +365,12 @@ tty_putc(struct tty *tty, u_char ch) void tty_pututf8(struct tty *tty, const struct grid_utf8 *gu) { - u_int i; - - for (i = 0; i < UTF8_SIZE; i++) { - if (gu->data[i] == 0xff) - break; - bufferevent_write(tty->event, &gu->data[i], 1); - if (tty->log_fd != -1) - write(tty->log_fd, &gu->data[i], 1); - } + size_t size; + size = grid_utf8_size(gu); + bufferevent_write(tty->event, gu->data, size); + if (tty->log_fd != -1) + write(tty->log_fd, gu->data, size); tty->cx += gu->width; } |