Kernel - Fixed VTerm tab behavior when width is not a multiple of 8
authorJohn Hodge <[email protected]>
Sun, 3 Jul 2011 03:11:02 +0000 (11:11 +0800)
committerJohn Hodge <[email protected]>
Sun, 3 Jul 2011 03:11:02 +0000 (11:11 +0800)
Kernel/drv/vterm.c

index 2b9f656..de920d8 100644 (file)
@@ -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

UCC git Repository :: git.ucc.asn.au