From c5f018985976642683dcd5acaeaa7f17ae988a92 Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Sun, 24 Apr 2022 18:47:04 +0200 Subject: [PATCH] Connection::Buffer: Remove duplicated new line character "a\r".gsub(/\r?$/, "\n") ==> "a\n\n" --- lib/runner/connection/buffer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/runner/connection/buffer.rb b/lib/runner/connection/buffer.rb index 12e99aa3..022b9299 100644 --- a/lib/runner/connection/buffer.rb +++ b/lib/runner/connection/buffer.rb @@ -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