diff --git a/ChangeLog b/ChangeLog index 24ac3196c7..384ec2a887 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Sep 15 00:03:07 2006 Tanaka Akira + + * ext/digest/lib/digest.rb (Digest::Base.file): open a file in binary + mode. suggested by Kazuhiro NISHIYAMA. [ruby-dev:29579] + Thu Sep 14 17:21:07 2006 Yukihiro Matsumoto * numeric.c (fix_mul): avoid bignum multiplication as far as diff --git a/ext/digest/lib/digest.rb b/ext/digest/lib/digest.rb index e8f54eae59..6ee1a0fbdf 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