summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/tty.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2009-07-22 15:55:32 +0000
committernicm <nicm@openbsd.org>2009-07-22 15:55:32 +0000
commitcb51af3f1f98875049b60b7a1095e5de99e7454b (patch)
tree6fa4ae2cebc6b676c78434ab24c399bc2d05518b /usr.bin/tmux/tty.c
parententer_user() is only called in one way, rendering the third parameter (diff)
downloadwireguard-openbsd-cb51af3f1f98875049b60b7a1095e5de99e7454b.tar.xz
wireguard-openbsd-cb51af3f1f98875049b60b7a1095e5de99e7454b.zip
tty_cmd_raw is only used once, for raw UTF-8 output, so rename it to
tty_cmd_utf8character and eliminate the size argument.
Diffstat (limited to 'usr.bin/tmux/tty.c')
-rw-r--r--usr.bin/tmux/tty.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c
index 3b448736160..62586ec4ed0 100644
--- a/usr.bin/tmux/tty.c
+++ b/usr.bin/tmux/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.10 2009/07/10 07:11:59 nicm Exp $ */
+/* $OpenBSD: tty.c,v 1.11 2009/07/22 15:55:32 nicm 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,
};
@@ -869,16 +869,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