From 1466f312bad35809fa9fe343068d2fc8a814ffe6 Mon Sep 17 00:00:00 2001 From: Curtis Cablegram Date: Wed, 28 Jul 2010 19:34:04 -0500 Subject: Change log-tailer to properly track multi-byte characters. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When end-of-line is represented within a file as "\r\n", it is represented in memory as a single "\n". This patch eliminates the discrepancy between size on disk and size in memory. Signed-off-by: José Valim --- railties/lib/rails/rack/log_tailer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties') diff --git a/railties/lib/rails/rack/log_tailer.rb b/railties/lib/rails/rack/log_tailer.rb index 3fa45156c3..2ca6b5f8da 100644 --- a/railties/lib/rails/rack/log_tailer.rb +++ b/railties/lib/rails/rack/log_tailer.rb @@ -24,7 +24,7 @@ module Rails if mod > @last_checked contents = @file.read @last_checked = mod - @cursor += contents.size + @cursor = @file.tell $stdout.print contents end end -- cgit v1.2.3