diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-12-14 12:50:13 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-12-14 12:50:13 +0000 |
commit | 92e9bf7a59acf3b625b6ae7e2020a49336213856 (patch) | |
tree | 58419ad68b8dd2d6d1795c1e45657768c0a5fb4b /lib/find.rb | |
parent | 4df4a7430865257795938c3dd791e3c0afee8778 (diff) |
* lib/find.rb (Find.find): narrow rescue region.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/find.rb')
-rw-r--r-- | lib/find.rb | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/find.rb b/lib/find.rb index 16a6a26069..7727bbdbbc 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 |