From 38b185f1dc4d296eb49c94a3ccff7496b1367c84 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Fri, 14 Dec 2007 17:48:11 +0000 Subject: [PATCH] Fixed: empty lines when displaying repository files with Windows style eol. git-svn-id: http://redmine.rubyforge.org/svn/trunk@993 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/repositories_controller.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index dfd5d0a6..ef332eb3 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -92,6 +92,9 @@ class RepositoriesController < ApplicationController show_error and return unless @content if 'raw' == params[:format] send_data @content, :filename => @path.split('/').last + else + # Prevent empty lines when displaying a file with Windows style eol + @content.gsub!("\r\n", "\n") end end