From a0e26acc7ae10c2a4b42a7bd47c2065c3182af6b Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 14 Dec 2009 12:50:13 +0000 Subject: * lib/find.rb (Find.find): narrow rescue region. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@26098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/find.rb | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'lib') diff --git a/lib/find.rb b/lib/find.rb index 16a6a2606..7727bbdbb 100644 --- a/lib/find.rb +++ b/lib/find.rb @@ -44,18 +44,19 @@ module Find rescue SystemCallError next end - begin - if s.directory? then + if s.directory? then + begin fs = Dir.entries(file) - fs.sort! - fs.reverse_each {|f| - next if f == "." or f == ".." - f = File.join(file, f) - paths.unshift f.untaint - } - end - rescue Errno::ENOENT, Errno::EACCES - end + rescue Errno::ENOENT, Errno::EACCES + next + end + fs.sort! + fs.reverse_each {|f| + next if f == "." or f == ".." + f = File.join(file, f) + paths.unshift f.untaint + } + end end end end -- cgit