summaryrefslogtreecommitdiffstats
path: root/key-string.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-01-12 20:24:12 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-01-12 20:24:12 +0000
commitab219847aa2be6e3f12d9a47655bec055e590c11 (patch)
tree180e04d40bac5c3e6cfeb5d5c08a43589ebb14d7 /key-string.c
parent1f51a63d010c2b0808277aa975fb2ef644397c16 (diff)
Tidy escape modifier (don't know how this worked before...).
Diffstat (limited to 'key-string.c')
-rw-r--r--key-string.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/key-string.c b/key-string.c
index a7607962..f3ca700a 100644
--- a/key-string.c
+++ b/key-string.c
@@ -1,4 +1,4 @@
-/* $Id: key-string.c,v 1.13 2009-01-12 20:13:20 nicm Exp $ */
+/* $Id: key-string.c,v 1.14 2009-01-12 20:24:12 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -89,7 +89,7 @@ int
key_string_lookup_string(const char *string)
{
int key;
- const char *ptr;
+ const u_char *ptr;
if (string[0] == '\0')
return (KEYC_NONE);
@@ -120,9 +120,18 @@ key_string_lookup_string(const char *string)
}
if (string[0] == 'M' && string[1] == '-') {
- if ((key = key_string_lookup_string(string + 2)) == KEYC_NONE)
+ ptr = string + 2;
+ if (ptr[0] == '\0')
return (KEYC_NONE);
- return (KEYC_ADDESC(key));
+ if (ptr[1] == '\0') {
+ if (ptr[0] < 32 || ptr[0] > 127)
+ return (KEYC_NONE);
+ return (KEYC_ADDESC(ptr[0]));
+ }
+ key = key_string_lookup_string(ptr);
+ if (key != KEYC_NONE)
+ return (KEYC_ADDESC(key));
+ return (KEYC_NONE);
}
return (key_string_search_table(string));