From 9541c63080623dbfa8b009eccc344920e8adac93 Mon Sep 17 00:00:00 2001 From: usa Date: Thu, 25 Dec 2008 05:53:22 +0000 Subject: * lib/rdoc/parser.rb (RDoc::Parser.binary?): should read in binary mode. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ lib/rdoc/parser.rb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ab6df840b9..7386a4f014 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Dec 25 14:51:43 2008 NAKAMURA Usaku + + * lib/rdoc/parser.rb (RDoc::Parser.binary?): should read in binary mode. + Thu Dec 25 14:32:23 2008 Koichi Sasada * vm_insnhelper.c (vm_method_search): fix control flow bug. diff --git a/lib/rdoc/parser.rb b/lib/rdoc/parser.rb index c37256dbd8..6b1233c62d 100644 --- a/lib/rdoc/parser.rb +++ b/lib/rdoc/parser.rb @@ -67,7 +67,7 @@ class RDoc::Parser # the gem). def self.binary?(file) - s = (File.read(file, File.stat(file).blksize) || "").split(//) + s = (File.read(file, File.stat(file).blksize, 0, :mode => "rb") || "").split(//) if s.size > 0 then ((s.size - s.grep(" ".."~").size) / s.size.to_f) > 0.30 -- cgit v1.2.3