diff options
Diffstat (limited to 'usr.bin/tmux/key-string.c')
-rw-r--r-- | usr.bin/tmux/key-string.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/usr.bin/tmux/key-string.c b/usr.bin/tmux/key-string.c index 2de7682407b..0012f89771d 100644 --- a/usr.bin/tmux/key-string.c +++ b/usr.bin/tmux/key-string.c @@ -1,4 +1,4 @@ -/* $OpenBSD: key-string.c,v 1.23 2012/03/04 20:40:54 nicm Exp $ */ +/* $OpenBSD: key-string.c,v 1.24 2013/03/22 10:30:04 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -136,9 +136,10 @@ key_string_get_modifiers(const char **string) int key_string_lookup_string(const char *string) { - int key, modifiers; - u_short u; - int size; + static const char *other = "!#()+,-.0123456789:;<=>?'\r\t"; + int key, modifiers; + u_short u; + int size; /* Is this a hexadecimal value? */ if (string[0] == '0' && string[1] == 'x') { @@ -170,7 +171,7 @@ key_string_lookup_string(const char *string) } /* Convert the standard control keys. */ - if (key < KEYC_BASE && (modifiers & KEYC_CTRL)) { + if (key < KEYC_BASE && (modifiers & KEYC_CTRL) && !strchr(other, key)) { if (key >= 97 && key <= 122) key -= 96; else if (key >= 64 && key <= 95) @@ -193,7 +194,7 @@ key_string_lookup_key(int key) { static char out[24]; char tmp[8]; - u_int i; + u_int i; *out = '\0'; |