comparison mcabber/src/screen.c @ 1357:7bbfb0073f88

Fix an UTF-8 problem in new hook_execute_internal() function There could be a double UTF-8 encoding, if the user has a non-utf8 locale. BTW improve bindcommand() -- unnecessary string duplication.
author Mikael Berthe <mikael@lilotux.net>
date Sun, 11 Nov 2007 11:29:16 +0100
parents 9716cf8a0726
children 7daf906fbcdc
comparison
equal deleted inserted replaced
1356:7794d76ca90e 1357:7bbfb0073f88
3676 g_snprintf(asciikey, 15, "MK%d", kcode.mcode); 3676 g_snprintf(asciikey, 15, "MK%d", kcode.mcode);
3677 3677
3678 boundcmd = settings_get(SETTINGS_TYPE_BINDING, asciikey); 3678 boundcmd = settings_get(SETTINGS_TYPE_BINDING, asciikey);
3679 3679
3680 if (boundcmd) { 3680 if (boundcmd) {
3681 gchar *cmdline, *boundcmd_locale; 3681 gchar *cmdline = from_utf8(boundcmd);
3682 boundcmd_locale = from_utf8(boundcmd);
3683 cmdline = g_strdup_printf(mkcmdstr("%s"), boundcmd_locale);
3684 scr_CheckAutoAway(TRUE); 3682 scr_CheckAutoAway(TRUE);
3685 if (process_command(cmdline, TRUE)) 3683 if (process_command(cmdline, TRUE))
3686 return 255; // Quit 3684 return 255; // Quit
3687 g_free(boundcmd_locale);
3688 g_free(cmdline); 3685 g_free(cmdline);
3689 return 0; 3686 return 0;
3690 } 3687 }
3691 3688
3692 scr_LogPrint(LPRINT_NORMAL, "Unknown key=%s", asciikey); 3689 scr_LogPrint(LPRINT_NORMAL, "Unknown key=%s", asciikey);