diff options
Diffstat (limited to 'lib/rdoc/parser.rb')
-rw-r--r-- | lib/rdoc/parser.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rdoc/parser.rb b/lib/rdoc/parser.rb index bb7e0c7d81..3798734d5e 100644 --- a/lib/rdoc/parser.rb +++ b/lib/rdoc/parser.rb @@ -66,8 +66,8 @@ class RDoc::Parser # Return _true_ if the +file+ seems like binary. def self.binary?(file) - s = File.read(file, 1024) - s.count("^ -~\t\r\n").fdiv(s.size) > 0.3 || s.index("\x00") unless s.empty? + s = File.read(file, 1024) or return false + s.count("^ -~\t\r\n").fdiv(s.size) > 0.3 || s.index("\x00") end private_class_method :binary? |