summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2018-10-28 15:34:28 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2018-10-28 15:34:28 +0000
commitc3e38951a46b1c4f890ac4792876ddfbfc310bc9 (patch)
tree24cfdac9ae515e948961297a2f2d8825d348e08f
parent4bc910214ed0a2836439008861e76a305770dc27 (diff)
Do not check for a key again without an escape if only \033 is present.
-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 */