summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authoreban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-06-20 08:59:59 +0000
committereban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-06-20 08:59:59 +0000
commit75c89b7eefd32e609b8141541a3cc22bb1c5d6f7 (patch)
treebf8f4487140755e3255a9e061873cc7e45728c6b /lib
parente97d0b7764969431782fadf6c074ee867583efa0 (diff)
* 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
Diffstat (limited to 'lib')
-rw-r--r--lib/ftools.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ftools.rb b/lib/ftools.rb
index 1b06bf5ecb..6e1c886e56 100644
--- a/lib/ftools.rb
+++ b/lib/ftools.rb
@@ -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)