From 7878c1699ef72b4cae5d51f520883cd93a1e83d8 Mon Sep 17 00:00:00 2001 From: Dan White Date: Tue, 14 May 2013 14:27:47 -0500 Subject: [PATCH] msp4th: proper cr/nl handling --- msp4th/msp4th.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; -- 2.25.1