console: fix bug in *_move_left()
authorDavid Herrmann <dh.herrmann@googlemail.com>
Sun, 5 Feb 2012 14:04:43 +0000 (15:04 +0100)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Sun, 5 Feb 2012 14:04:43 +0000 (15:04 +0100)
We must take care of pending-wraps when moving left so we do not miss a
single character.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
src/console.c

index 4ad3c76..0e44570 100644 (file)
@@ -382,6 +382,9 @@ void kmscon_console_move_left(struct kmscon_console *con, unsigned int num)
        if (num > con->cells_x)
                num = con->cells_x;
 
+       if (con->cursor_x >= con->cells_x)
+               con->cursor_x = con->cells_x - 1;
+
        if (num > con->cursor_x)
                con->cursor_x = 0;
        else