--- rxvt-unicode/src/keyboard.C 2011/11/27 10:49:25 1.47 +++ rxvt-unicode/src/keyboard.C 2011/12/01 11:27:34 1.51 @@ -65,14 +65,14 @@ */ static void -output_string (rxvt_term *rt, const char *str) +output_string (rxvt_term *term, const char *str) { if (strncmp (str, "command:", 8) == 0) - rt->cmdbuf_append (str + 8, strlen (str) - 8); + term->cmdbuf_append (str + 8, strlen (str) - 8); else if (strncmp (str, "perl:", 5) == 0) - HOOK_INVOKE((rt, HOOK_USER_COMMAND, DT_STR, str + 5, DT_END)); + HOOK_INVOKE((term, HOOK_USER_COMMAND, DT_STR, str + 5, DT_END)); else - rt->tt_write (str, strlen (str)); + term->tt_write (str, strlen (str)); } // return: priority_of_a - priority_of_b @@ -100,16 +100,11 @@ keyboard_manager::~keyboard_manager () { - hash [0] = 2; - for (unsigned int i = 0; i < keymap.size (); ++i) { free (keymap [i]->str); delete keymap [i]; - keymap [i] = 0; } - - keymap.clear (); } // a wrapper for register_translation that converts the input string @@ -117,9 +112,9 @@ void keyboard_manager::register_user_translation (KeySym keysym, unsigned int state, const char *trans) { - wchar_t *wc = rxvt_mbstowcs (trans); - char *translation = rxvt_wcstoutf8 (wc); - free (wc); + wchar_t *ws = rxvt_mbstowcs (trans); + char *translation = rxvt_wcstoutf8 (ws); + free (ws); if (strncmp (translation, "list", 4) == 0 && translation [4] && strlen (translation) < STRING_MAX) @@ -200,14 +195,14 @@ if (index >= 0) { - const keysym_t &key = *keymap [index]; + keysym_t *key = keymap [index]; - if (key.type != keysym_t::BUILTIN) + if (key->type != keysym_t::BUILTIN) { - wchar_t *wc = rxvt_utf8towcs (key.str); - char *str = rxvt_wcstombs (wc); + wchar_t *ws = rxvt_utf8towcs (key->str); + char *str = rxvt_wcstombs (ws); // TODO: do (some) translations, unescaping etc, here (allow \u escape etc.) - free (wc); + free (ws); output_string (term, str);