chiark / gitweb /
terminal/screen: fix GL/GR double-mapping
authorDavid Herrmann <dh.herrmann@gmail.com>
Sun, 30 Nov 2014 13:37:12 +0000 (14:37 +0100)
committerDavid Herrmann <dh.herrmann@gmail.com>
Sun, 30 Nov 2014 13:37:57 +0000 (14:37 +0100)
We must not call screen_map() multiple times for the same input char. Fix
the double-mapping for GL/GR maps are correctly applied.

src/libsystemd-terminal/term-screen.c

index acd7cc9..51d9376 100644 (file)
@@ -549,7 +549,6 @@ static int screen_LF(term_screen *screen, const term_seq *seq);
 
 static int screen_GRAPHIC(term_screen *screen, const term_seq *seq) {
         term_char_t ch = TERM_CHAR_NULL;
-        uint32_t c;
 
         if (screen->state.cursor_x + 1 == screen->page->width
             && screen->flags & TERM_FLAG_PENDING_WRAP
@@ -560,8 +559,7 @@ static int screen_GRAPHIC(term_screen *screen, const term_seq *seq) {
 
         screen_cursor_clear_wrap(screen);
 
-        c = screen_map(screen, seq->terminator);
-        ch = term_char_merge(ch, screen_map(screen, c));
+        ch = term_char_merge(ch, screen_map(screen, seq->terminator));
         term_page_write(screen->page, screen->state.cursor_x, screen->state.cursor_y, ch, 1, &screen->state.attr, screen->age, false);
 
         if (screen->state.cursor_x + 1 == screen->page->width)