Skip to content

Commit

Permalink
Split lines on CR as well as CR/CRLF
Browse files Browse the repository at this point in the history
This chases an upstream commit bce415d
and fixes possible mishandling of sent commands.
  • Loading branch information
tadzik committed Apr 29, 2022
1 parent 7130026 commit e3eb9c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/irc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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), []);
}
Expand Down

0 comments on commit e3eb9c1

Please sign in to comment.