ruby-changes:9448
From: usa <ko1@a...>
Date: Thu, 25 Dec 2008 14:53:40 +0900 (JST)
Subject: [ruby-changes:9448] Ruby:r20986 (trunk): * lib/rdoc/parser.rb (RDoc::Parser.binary?): should read in binary mode.
usa 2008-12-25 14:53:22 +0900 (Thu, 25 Dec 2008) New Revision: 20986 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20986 Log: * lib/rdoc/parser.rb (RDoc::Parser.binary?): should read in binary mode. Modified files: trunk/ChangeLog trunk/lib/rdoc/parser.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 20985) +++ ChangeLog (revision 20986) @@ -1,3 +1,7 @@ +Thu Dec 25 14:51:43 2008 NAKAMURA Usaku <usa@r...> + + * lib/rdoc/parser.rb (RDoc::Parser.binary?): should read in binary mode. + Thu Dec 25 14:32:23 2008 Koichi Sasada <ko1@a...> * vm_insnhelper.c (vm_method_search): fix control flow bug. Index: lib/rdoc/parser.rb =================================================================== --- lib/rdoc/parser.rb (revision 20985) +++ lib/rdoc/parser.rb (revision 20986) @@ -67,7 +67,7 @@ # 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/