Code

screen_utils: Fixed backspace with widecharacters in screen_jump().
authorPatrick Hallen <patrick.hallen@rwth-aachen.de>
Sat, 28 Mar 2009 18:01:31 +0000 (19:01 +0100)
committerPatrick Hallen <patrick.hallen@rwth-aachen.de>
Sat, 28 Mar 2009 18:01:31 +0000 (19:01 +0100)
Deleting widecharacters with backspace would leave bytes in the buffer
before. Now every byte of a deleted widecharacter is replaced with '\0'.

src/screen_utils.c

index 971b8838b8bc27aab4690285fd4c42651bca5d48..8eddfc597fd46c33d4489cbbe4bbac54ea943cff 100644 (file)
@@ -244,11 +244,13 @@ screen_jump(struct list_window *lw,
                key = screen_getch(screen.status_window.w, screen.findbuf);
                /* if backspace or delete was pressed */
                if (key == KEY_BACKSPACE || key == 330) {
+                       int i;
                        /* don't end the loop */
                        key = 65;
                        if (search_str <= g_utf8_find_prev_char(screen.findbuf, iter))
                                iter = g_utf8_find_prev_char(screen.findbuf, iter);
-                       *iter = '\0';
+                       for (i = 0; *(iter + i) != '\0'; i++)
+                               *(iter + i) = '\0';
                        continue;
                }
                else {