Skip to contentSkip to conversation

Trivial console_putchar() fixes

PATCH Applied Markus Armbruster 2 participants 4 messages Nov 22, 2011 – Nov 23, 2011

lore
Share & tools
lore
#2 lore raw

PATCH 2/2 console: Fix console_putchar() for CSI J

In reply to Markus Armbruster

It falls through to the code for CSI K. "Erase Down" also does "Erase End of Line", "Erase Up" also does "Erase Start of Line", and "Erase Screen" also does "Erase Line". Happens not to be visible. Fix it anyway. Spotted by Coverity.

---
 console.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
console.c +1 -0
index 374fcba..ce0429d 100644
@@ -1011,6 +1011,7 @@ static void console_putchar(TextConsole *s, int ch)
                     }
                     break;
                 }
+                break;
             case 'K':
                 switch (s->esc_params[0]) {
                 case 0:
Signature · 1 line
1.7.6.4
#0 lore raw

cover Trivial console_putchar() fixes

Markus Armbruster (2):
console: Clean up confusing indentation in console_putchar()
console: Fix console_putchar() for CSI J

 console.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)
Signature · 1 line
1.7.6.4
#1 lore raw

PATCH 1/2 console: Clean up confusing indentation in console_putchar()

---
 console.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
console.c +9 -9
index f6fe441..374fcba 100644
@@ -1009,16 +1009,16 @@ static void console_putchar(TextConsole *s, int ch)
                             console_clear_xy(s, x, y);
                         }
                     }
-                break;
+                    break;
                 }
             case 'K':
                 switch (s->esc_params[0]) {
                 case 0:
-                /* clear to eol */
-                for(x = s->x; x < s->width; x++) {
+                    /* clear to eol */
+                    for(x = s->x; x < s->width; x++) {
                         console_clear_xy(s, x, s->y);
-                }
-                break;
+                    }
+                    break;
                 case 1:
                     /* clear from beginning of line */
                     for (x = 0; x <= s->x; x++) {
@@ -1030,12 +1030,12 @@ static void console_putchar(TextConsole *s, int ch)
                     for(x = 0; x < s->width; x++) {
                         console_clear_xy(s, x, s->y);
                     }
-                break;
-            }
+                    break;
+                }
                 break;
             case 'm':
-            console_handle_escape(s);
-            break;
+                console_handle_escape(s);
+                break;
             case 'n':
                 /* report cursor position */
                 /* TODO: send ESC[row;colR */
Signature · 1 line
1.7.6.4