diff options
author | Timo Sirainen <cras@irssi.org> | 2000-07-23 00:38:46 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-07-23 00:38:46 +0000 |
commit | a31ac88d7da6f02f8ebec5a95f09bf2c7953377d (patch) | |
tree | 83ac8c65473fb9c4c557d3f59a45aaa6222ba131 /src | |
parent | 6a3881ce5cf7fe3dffc0ef16b47f7428b61bbd3a (diff) | |
download | irssi-a31ac88d7da6f02f8ebec5a95f09bf2c7953377d.zip |
Listing keys with /BIND key now checks the keys case-insensitively.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@512 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r-- | src/fe-common/core/keyboard.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/fe-common/core/keyboard.c b/src/fe-common/core/keyboard.c index f33560f3..2d340ef5 100644 --- a/src/fe-common/core/keyboard.c +++ b/src/fe-common/core/keyboard.c @@ -279,7 +279,7 @@ static void read_keyboard_config(void) } } -static void cmd_show_keys(const char *searchkey) +static void cmd_show_keys(const char *searchkey, int full) { GSList *info, *key; int len; @@ -291,7 +291,8 @@ static void cmd_show_keys(const char *searchkey) for (key = rec->keys; key != NULL; key = key->next) { KEY_REC *rec = key->data; - if (len == 0 || strncmp(rec->key, searchkey, len) == 0) { + if ((len == 0 || g_strncasecmp(rec->key, searchkey, len) == 0) && + (!full || rec->key[len] == '\0')) { printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_BIND_KEY, rec->key, rec->info->id, rec->data == NULL ? "" : rec->data); } @@ -313,12 +314,12 @@ static void cmd_bind(const char *data) key_configure_remove(key); } else if (*id == '\0') { /* show some/all keys */ - cmd_show_keys(key); + cmd_show_keys(key, FALSE); } else if (key_info_find(id) == NULL) printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, IRCTXT_BIND_UNKNOWN_ID, id); else { key_configure_add(id, key, keydata); - cmd_show_keys(key); + cmd_show_keys(key, TRUE); } cmd_params_free(free_arg); |