From 2043c39808d80fa4c011041864390545c80462e5 Mon Sep 17 00:00:00 2001 From: akr Date: Thu, 14 Sep 2006 15:05:22 +0000 Subject: [PATCH] * 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 --- ChangeLog | 5 +++++ ext/digest/lib/digest.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) 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