diff --git a/ChangeLog b/ChangeLog index e106ed03cc..4abc846895 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Feb 20 13:46:19 2006 NAKAMURA Usaku + + * lib/find.rb: should raise ENOENT if root entry does not exist, + without opening it. [ruby-dev:28345] + Mon Feb 20 12:27:53 2006 Kent Sibilev * lib/rational.rb (Integer::gcd): small typo fix. diff --git a/lib/find.rb b/lib/find.rb index b2e811e614..06ac9e2c0c 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