mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
1f2d804e5e
commit
9541c63080
2 changed files with 5 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
|||
Thu Dec 25 14:51:43 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* lib/rdoc/parser.rb (RDoc::Parser.binary?): should read in binary mode.
|
||||
|
||||
Thu Dec 25 14:32:23 2008 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* vm_insnhelper.c (vm_method_search): fix control flow bug.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue