diff options
| author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-25 09:57:29 +0000 |
|---|---|---|
| committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-25 09:57:29 +0000 |
| commit | e6780ce797bc04298364bc2e80fae559b499121c (patch) | |
| tree | 52d15d640b39c93f49e262bb371a6e9d0103e917 | |
| parent | 6194a746509735a5a77056d720574065cb6a9a01 (diff) | |
merges r20986 from trunk into ruby_1_9_1.
* lib/rdoc/parser.rb (RDoc::Parser.binary?): should read in binary mode.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@21037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | lib/rdoc/parser.rb | 2 |
2 files changed, 5 insertions, 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 13:28:20 2008 NAKAMURA Usaku <usa@ruby-lang.org> * io.c (rb_io_flush): fsync() after buffer is flushed on win32. diff --git a/lib/rdoc/parser.rb b/lib/rdoc/parser.rb index c37256dbd..6b1233c62 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 |
