This code failed on strings that end on a multibyte character.
static void
keycmd_bs (WebKitWebView *page, GArray *argv) {
+ gchar *prev;
(void)page;
(void)argv;
- g_string_truncate(uzbl.state.keycmd, uzbl.state.keycmd->len - 1);
+ prev = g_utf8_find_prev_char(uzbl.state.keycmd->str, uzbl.state.keycmd->str + uzbl.state.keycmd->len);
+ if (prev)
+ g_string_truncate(uzbl.state.keycmd, prev - uzbl.state.keycmd->str);
update_title();
}