summaryrefslogtreecommitdiff
path: root/ext/digest/lib/digest.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-09-14 15:05:22 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-09-14 15:05:22 +0000
commit2043c39808d80fa4c011041864390545c80462e5 (patch)
tree0ba4afb92b910e464e7f4b3658308413e7b0adcf /ext/digest/lib/digest.rb
parentaf05fa6a40440b0ce65870952284bb992e4d08bf (diff)
* ext/digest/lib/digest.rb (Digest::Base.file): open a file in binary
mode. suggested by Kazuhiro NISHIYAMA. [ruby-dev:29579] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/digest/lib/digest.rb')
-rw-r--r--ext/digest/lib/digest.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/digest/lib/digest.rb b/ext/digest/lib/digest.rb
index e8f54eae59f..6ee1a0fbdfa 100644
--- a/ext/digest/lib/digest.rb
+++ b/ext/digest/lib/digest.rb
@@ -13,7 +13,7 @@ module Digest
# # => "f02e3c85572dc9ad7cb77c2a638e3be24cc1b5bea9fdbb0b0299c9668475c534"
def self.file(name)
digest = self.new
- File.open(name) {|f|
+ File.open(name, "rb") {|f|
buf = ""
while f.read(16384, buf)
digest.update buf