From e3eb9c15f8240e9c92365f5ffc3944469229771b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tadeusz=20So=C5=9Bnierz?= Date: Fri, 29 Apr 2022 10:39:17 +0200 Subject: [PATCH] Split lines on CR as well as CR/CRLF This chases an upstream commit bce415df277db25519bd702a08a3431dde2480e8 and fixes possible mishandling of sent commands. --- src/irc.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/irc.ts b/src/irc.ts index 54ba55ac..2c11e04d 100644 --- a/src/irc.ts +++ b/src/irc.ts @@ -1441,7 +1441,7 @@ export class Client extends EventEmitter { if (!text) { return []; } - return text.toString().split(/\r?\n/).filter((line) => line.length > 0) + return text.toString().split(/\r\n|\r|\n/).filter((line) => line.length > 0) .map((line) => splitLongLines(line, maxLength)) .reduce((a, b) => a.concat(b), []); }