1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/ftools.rb (compare): don't return with a file opened

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eban 2002-06-20 08:59:59 +00:00
parent e97d0b7764
commit 75c89b7eef

View file

@ -81,14 +81,14 @@ class << File
def compare from, to, verbose = false
$stderr.print from, " <=> ", to, "\n" if verbose
return false if stat(from).size != stat(to).size
from = open(from, "rb")
to = open(to, "rb")
ret = false
fr = tr = ''
return false if from.stat.size != to.stat.size
begin
while fr == tr
fr = from.read(BUFSIZE)