From 7bdde2d359c1e86a0cf3c21836f6c510b4a41e29 Mon Sep 17 00:00:00 2001 From: "Justin C. Miller" Date: Wed, 23 Dec 2020 12:36:43 -0800 Subject: [PATCH] [kernel] Fix console line endings The console's putc() was looking for CRs and if it saw one, appending an LF. The output was only writing LFs, though, so instead what's needed is to look for LFs, and if it sees one, insert a CR first. --- src/kernel/console.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kernel/console.cpp b/src/kernel/console.cpp index cd1b7d1..0382120 100644 --- a/src/kernel/console.cpp +++ b/src/kernel/console.cpp @@ -279,8 +279,8 @@ console::putc(char c) if (m_screen) m_screen->putc(c); if (m_serial) { + if (c == '\n') m_serial->write('\r'); m_serial->write(c); - if (c == '\r') m_serial->write('\n'); } }