From: Dan White Date: Tue, 14 May 2013 19:27:47 +0000 (-0500) Subject: msp4th: proper cr/nl handling X-Git-Tag: cheetah~70 X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=7878c1699ef72b4cae5d51f520883cd93a1e83d8;p=430.git msp4th: proper cr/nl handling --- diff --git a/msp4th/msp4th.c b/msp4th/msp4th.c index d81ce65..b7ebda7 100644 --- a/msp4th/msp4th.c +++ b/msp4th/msp4th.c @@ -499,6 +499,10 @@ void getLine(void) } else { if (echo) { msp4th_putchar(c); + + if (c == '\r') { + msp4th_putchar('\n'); + } } if ( (c == '\r') || @@ -506,8 +510,6 @@ void getLine(void) (lineBufferIdx >= (lineBufferLength - 1))) { // prevent overflow of line buffer waiting = 0; - - if (echo) { msp4th_putchar('\n'); } } lineBuffer[lineBufferIdx++] = c;