From 511006fa63fa67fa860541365a2d0a8936d43252 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 3 Jul 2011 11:11:02 +0800 Subject: [PATCH] Kernel - Fixed VTerm tab behavior when width is not a multiple of 8 --- Kernel/drv/vterm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Kernel/drv/vterm.c b/Kernel/drv/vterm.c index 2b9f6562..de920d8d 100644 --- a/Kernel/drv/vterm.c +++ b/Kernel/drv/vterm.c @@ -1247,13 +1247,15 @@ void VT_int_PutChar(tVTerm *Term, Uint32 Ch) write_pos -= write_pos % Term->TextWidth; break; - case '\t': + case '\t': { int tmp = write_pos / Term->TextWidth; + write_pos %= Term->TextWidth; do { buffer[ write_pos ].Ch = '\0'; buffer[ write_pos ].Colour = Term->CurColour; write_pos ++; } while(write_pos & 7); - break; + write_pos += tmp * Term->TextWidth; + break; } case '\b': // Backspace is invalid at Offset 0 -- 2.20.1