summaryrefslogtreecommitdiff
path: root/src/fe-common
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-08-12 17:02:06 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-08-12 17:02:06 +0000
commit55be71a726a82d2d6c2afbfc4b43299379ee75b2 (patch)
treeebdc54f5c9fd75f5d338163b30831ff94d4b65b2 /src/fe-common
parent22e5f3a3fecb0f986e93d48b152af71cd3365313 (diff)
downloadirssi-55be71a726a82d2d6c2afbfc4b43299379ee75b2.zip
Bugfix to keyb. code :) And now the "key" names can contain only
alphanumeric + '_' characters, which makes /BIND foo meta-5~ work again because 5~ are treated separately, not as one "key" name. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1739 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common')
-rw-r--r--src/fe-common/core/keyboard.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/fe-common/core/keyboard.c b/src/fe-common/core/keyboard.c
index 1fd15d5b..bfcba6d0 100644
--- a/src/fe-common/core/keyboard.c
+++ b/src/fe-common/core/keyboard.c
@@ -261,7 +261,19 @@ static int expand_key(const char *key, GSList **out)
/* meta-^W^Gf -> ^[-^W-^G-f */
start = NULL; last_hyphen = TRUE;
- for (; *key != '\0'; key++) {
+ for (; *key != '\0'; key++) {
+ if (start != NULL) {
+ if (isalnum(*key) || *key == '_') {
+ /* key combo continues */
+ continue;
+ }
+
+ if (!expand_combo(start, key-1, out))
+ return FALSE;
+ expand_out_char(*out, '-');
+ start = NULL;
+ }
+
if (*key == '-') {
if (last_hyphen) {
expand_out_char(*out, '-');
@@ -279,18 +291,10 @@ static int expand_key(const char *key, GSList **out)
last_hyphen = TRUE;
} else {
/* key / combo */
- if (start == NULL)
- start = key;
+ start = key;
last_hyphen = FALSE;
continue;
}
-
- if (start != NULL) {
- if (!expand_combo(start, key-1, out))
- return FALSE;
- expand_out_char(*out, '-');
- start = NULL;
- }
}
if (start != NULL)