summaryrefslogtreecommitdiffstats
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
commit56bafeab2c8f95d3c1eafd50228e2952a108e38a (patch)
treebf8f4487140755e3255a9e061873cc7e45728c6b
parent9765ed088be7e3835b815a14bca31b1fe339414b (diff)
downloadruby-56bafeab2c8f95d3c1eafd50228e2952a108e38a.tar.gz
ruby-56bafeab2c8f95d3c1eafd50228e2952a108e38a.tar.xz
ruby-56bafeab2c8f95d3c1eafd50228e2952a108e38a.zip
* lib/ftools.rb (compare): don't return with a file opened
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--lib/ftools.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ftools.rb b/lib/ftools.rb
index 1b06bf5ec..6e1c886e5 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)