From 85da8cbb07322addd8838df4d4c206843d77714f Mon Sep 17 00:00:00 2001 From: Aatos Majava Date: Thu, 14 Apr 2022 15:54:03 +0300 Subject: [PATCH] TelnetServer: Ignore null and \n when parsing This fixes issues with carriage return sequences. Before, using as the return sequence wouldn't work at all, and when using there was an extra newline after every newline. After this patch, the behaviour should be closer to the Telnet RFC. --- Userland/Services/TelnetServer/Parser.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Userland/Services/TelnetServer/Parser.cpp b/Userland/Services/TelnetServer/Parser.cpp index 89aa2eeeac..468c607ba5 100644 --- a/Userland/Services/TelnetServer/Parser.cpp +++ b/Userland/Services/TelnetServer/Parser.cpp @@ -24,6 +24,10 @@ void Parser::write(StringView data) if (on_data) on_data("\n"); break; + case '\0': + case '\n': + // Ignore. + break; default: if (on_data) on_data(StringView(&ch, 1));