diff options
author | 2014-02-10 11:20:41 +0000 | |
---|---|---|
committer | 2014-02-10 11:20:41 +0000 | |
commit | 06b16c35be2888e7aa9ae844886e8fccc31ce9a3 (patch) | |
tree | 0cf9a1a317d5906f8aa36ce9745cf913614510b4 /usr.bin/tmux/xterm-keys.c | |
parent | tweak usage() and bump version. (diff) | |
download | wireguard-openbsd-06b16c35be2888e7aa9ae844886e8fccc31ce9a3.tar.xz wireguard-openbsd-06b16c35be2888e7aa9ae844886e8fccc31ce9a3.zip |
The last fix to xterm keys meant that some keys such as \033OA were
being wrongly treated as partial matches. So both check xterm keys after
standard keys and only wildcard the minimum required ('1' to
'8'). Problems reported by Ralf Horstmann and Tim van der Molen.
Diffstat (limited to 'usr.bin/tmux/xterm-keys.c')
-rw-r--r-- | usr.bin/tmux/xterm-keys.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/tmux/xterm-keys.c b/usr.bin/tmux/xterm-keys.c index 2d6b601fb3d..235a7107aa9 100644 --- a/usr.bin/tmux/xterm-keys.c +++ b/usr.bin/tmux/xterm-keys.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xterm-keys.c,v 1.12 2014/01/31 11:20:28 nicm Exp $ */ +/* $OpenBSD: xterm-keys.c,v 1.13 2014/02/10 11:20:41 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net> @@ -131,7 +131,9 @@ xterm_keys_match(const char *template, const char *buf, size_t len) pos = 0; do { - if (*template != '_' && buf[pos] != *template) + if (*template == '_' && buf[pos] >= '1' && buf[pos] <= '8') + continue; + if (buf[pos] != *template) return (-1); } while (*++template != '\0' && ++pos != len); |