From: Austin Clements Date: Thu, 2 Sep 2010 22:50:49 +0000 (-0400) Subject: Get cgaputc and consputc back on the same page X-Git-Url: https://git.devinivas.org/?a=commitdiff_plain;h=08eef9eae5989d3a709588352e228041e62e2c2c;p=cs3210-lab0.git Get cgaputc and consputc back on the same page --- diff --git a/console.c b/console.c index a3cdf96..e7ed248 100644 --- a/console.c +++ b/console.c @@ -136,8 +136,7 @@ cgaputc(int c) if(c == '\n') pos += 80 - pos%80; else if(c == BACKSPACE){ - if(pos > 0) - crt[--pos] = ' ' | 0x0700; + if(pos > 0) --pos; } else crt[pos++] = (c&0xff) | 0x0700; // black on white @@ -164,15 +163,12 @@ consputc(int c) } if(c == BACKSPACE){ - uartputc('\b'); - uartputc(' '); - uartputc('\b'); + uartputc('\b'); uartputc(' '); uartputc('\b'); } else uartputc(c); cgaputc(c); } -//PAGEBREAK: 50 #define INPUT_BUF 128 struct { struct spinlock lock;