Connection::Buffer: Remove duplicated new line character

"a\r".gsub(/\r?$/, "\n") ==> "a\n\n"
This commit is contained in:
Sebastian Serth
2022-04-24 18:47:04 +02:00
parent 5ff4f06c69
commit c5f0189859

View File

@ -72,7 +72,7 @@ class Runner::Connection::Buffer
@global_buffer = +''
# For our buffering, we identified line breaks with the `\n` and removed those temporarily.
# Thus, we now re-add the `\n` at the end of the string and (optionally) remove a trailing `\r` at the same time.
message = message.gsub(/\r?$/, "\n")
message = "#{message.delete_suffix("\r")}\n"
@line_buffer.push message
end