summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-02-20 04:48:55 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-02-20 04:48:55 +0000
commit5a778f3bd05fff7021a065c12c0b3260b0710ab3 (patch)
treee07c42b1bd72aac6f2362348949ebe254e76d287 /lib
parent82c6063001a56cd324711703600e8ce7f44cdb36 (diff)
downloadruby-5a778f3bd05fff7021a065c12c0b3260b0710ab3.tar.gz
ruby-5a778f3bd05fff7021a065c12c0b3260b0710ab3.tar.xz
ruby-5a778f3bd05fff7021a065c12c0b3260b0710ab3.zip
* lib/find.rb: should raise ENOENT if root entry does not exist,
without opening it. [ruby-dev:28345] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@9969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/find.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/find.rb b/lib/find.rb
index b2e811e61..06ac9e2c0 100644
--- a/lib/find.rb
+++ b/lib/find.rb
@@ -33,7 +33,7 @@ module Find
# See the +Find+ module documentation for an example.
#
def find(*paths) # :yield: path
- paths.collect!{|d| open(d){}; d.dup}
+ paths.collect!{|d| raise Errno::ENOENT unless File.exist?(d); d.dup}
while file = paths.shift
catch(:prune) do
yield file.dup.taint