summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/rdoc/rdoc.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/rdoc/rdoc.rb b/lib/rdoc/rdoc.rb
index 9ddece89e0b..80128ee8ba5 100644
--- a/lib/rdoc/rdoc.rb
+++ b/lib/rdoc/rdoc.rb
@@ -203,11 +203,8 @@ module RDoc
file_list.each do |filename|
@stats.add_file filename
- content = if RUBY_VERSION >= '1.9' then
- File.open(filename, "r:ascii-8bit") { |f| f.read }
- else
- File.read filename
- end
+ content = File.open(filename, "rb") { |f| f.read }
+ content.gsub!(/\r$/, '')
if defined?(::Encoding) then
if /coding[=:]\s*([^\s;]+)/ =~ content[/\A(?:!.*\n)?(.*\n)/, 1]