diff options
author | Tiago Cunha <tcunha@gmx.com> | 2009-07-22 17:58:42 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2009-07-22 17:58:42 +0000 |
commit | 75a44d856e6b8bf6b1b09c57d630e99c66774214 (patch) | |
tree | 79d2c59f5cc5a6b655d804048280b7ecf3997224 | |
parent | 41207e4861ddce19ad19b869aca851d1e652c88d (diff) | |
download | rtmux-75a44d856e6b8bf6b1b09c57d630e99c66774214.tar.gz rtmux-75a44d856e6b8bf6b1b09c57d630e99c66774214.tar.bz2 rtmux-75a44d856e6b8bf6b1b09c57d630e99c66774214.zip |
Sync OpenBSD patchset 158:
tty_cmd_raw is only used once, for raw UTF-8 output, so rename it to
tty_cmd_utf8character and eliminate the size argument.
-rw-r--r-- | screen-write.c | 9 | ||||
-rw-r--r-- | tmux.h | 4 | ||||
-rw-r--r-- | tty.c | 19 |
3 files changed, 15 insertions, 17 deletions
diff --git a/screen-write.c b/screen-write.c index 26c9751b..41fcf38d 100644 --- a/screen-write.c +++ b/screen-write.c @@ -1,4 +1,4 @@ -/* $Id: screen-write.c,v 1.60 2009-07-15 17:43:02 nicm Exp $ */ +/* $Id: screen-write.c,v 1.61 2009-07-22 17:58:42 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -700,7 +700,6 @@ screen_write_cell( struct grid_utf8 gu, *tmp_gu; u_int width, xx, i; struct grid_cell tmp_gc, *tmp_gc2; - size_t size; int insert = 0; /* Ignore padding. */ @@ -737,11 +736,7 @@ screen_write_cell( memcpy(tmp_gu->data + i, udata, UTF8_SIZE - i); /* Assume the previous character has just been input. */ - for (size = 0; size < UTF8_SIZE; size++) { - if (udata[size] == 0xff) - break; - } - tty_write_cmd(ctx->wp, TTY_RAW, udata, size); + tty_write_cmd(ctx->wp, TTY_UTF8CHARACTER, udata); return; } @@ -1,4 +1,4 @@ -/* $Id: tmux.h,v 1.380 2009-07-22 17:46:53 tcunha Exp $ */ +/* $Id: tmux.h,v 1.381 2009-07-22 17:58:42 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -287,7 +287,7 @@ enum tty_cmd { TTY_INSERTCHARACTER, TTY_INSERTLINE, TTY_LINEFEED, - TTY_RAW, + TTY_UTF8CHARACTER, TTY_REVERSEINDEX, }; @@ -1,4 +1,4 @@ -/* $Id: tty.c,v 1.113 2009-07-12 17:08:37 nicm Exp $ */ +/* $Id: tty.c,v 1.114 2009-07-22 17:58:42 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -51,7 +51,7 @@ void tty_cmd_deleteline(struct tty *, struct window_pane *, va_list); void tty_cmd_insertcharacter(struct tty *, struct window_pane *, va_list); void tty_cmd_insertline(struct tty *, struct window_pane *, va_list); void tty_cmd_linefeed(struct tty *, struct window_pane *, va_list); -void tty_cmd_raw(struct tty *, struct window_pane *, va_list); +void tty_cmd_utf8character(struct tty *, struct window_pane *, va_list); void tty_cmd_reverseindex(struct tty *, struct window_pane *, va_list); void (*tty_cmds[])(struct tty *, struct window_pane *, va_list) = { @@ -68,7 +68,7 @@ void (*tty_cmds[])(struct tty *, struct window_pane *, va_list) = { tty_cmd_insertcharacter, tty_cmd_insertline, tty_cmd_linefeed, - tty_cmd_raw, + tty_cmd_utf8character, tty_cmd_reverseindex, }; @@ -879,16 +879,19 @@ tty_cmd_cell(struct tty *tty, struct window_pane *wp, va_list ap) } void -tty_cmd_raw(struct tty *tty, unused struct window_pane *wp, va_list ap) +tty_cmd_utf8character( + struct tty *tty, unused struct window_pane *wp, va_list ap) { u_char *buf; - size_t i, len; + size_t i; buf = va_arg(ap, u_char *); - len = va_arg(ap, size_t); - - for (i = 0; i < len; i++) + + for (i = 0; i < UTF8_SIZE; i++) { + if (buf[i] == 0xff) + break; tty_putc(tty, buf[i]); + } } void |