summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/tty-keys.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2018-10-28 15:34:27 +0000
committernicm <nicm@openbsd.org>2018-10-28 15:34:27 +0000
commitec97f12d57c2ea09d572207497d693d5d55d3144 (patch)
treed5e15ec7dd5fd5f9a972108d4a5d2bf58d9d4aed /usr.bin/tmux/tty-keys.c
parentlld generates DT_RUNPATH elements instead of the older DT_RPATH. (diff)
downloadwireguard-openbsd-ec97f12d57c2ea09d572207497d693d5d55d3144.tar.xz
wireguard-openbsd-ec97f12d57c2ea09d572207497d693d5d55d3144.zip
Do not check for a key again without an escape if only \033 is present.
Diffstat (limited to 'usr.bin/tmux/tty-keys.c')
-rw-r--r--usr.bin/tmux/tty-keys.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/tmux/tty-keys.c b/usr.bin/tmux/tty-keys.c
index 0605b05e7a8..8a72a498cf0 100644
--- a/usr.bin/tmux/tty-keys.c
+++ b/usr.bin/tmux/tty-keys.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty-keys.c,v 1.104 2018/10/18 08:04:14 nicm Exp $ */
+/* $OpenBSD: tty-keys.c,v 1.105 2018/10/28 15:34:27 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -624,7 +624,7 @@ first_key:
* If not a complete key, look for key with an escape prefix (meta
* modifier).
*/
- if (*buf == '\033') {
+ if (*buf == '\033' && len > 1) {
/* Look for a key without the escape. */
n = tty_keys_next1(tty, buf + 1, len - 1, &key, &size, expired);
if (n == 0) { /* found */