From a31ac88d7da6f02f8ebec5a95f09bf2c7953377d Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sun, 23 Jul 2000 00:38:46 +0000 Subject: [PATCH] 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 --- src/fe-common/core/keyboard.c | 9 +++++---- 1 file 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);