summaryrefslogtreecommitdiff
path: root/lib/find.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-02-06 09:28:03 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-02-06 09:28:03 +0000
commit70bf6c675419c2df1a5cd9f2f803e1a6a46d9d91 (patch)
treebea332cf97e74e61414f56eced92721ea42dc61d /lib/find.rb
parente8253cceca56c3b05fbe041acb0a82d600622fe0 (diff)
* several backports from 1.9
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/find.rb')
-rw-r--r--lib/find.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/find.rb b/lib/find.rb
index 9ca39cabcb..52efde81fd 100644
--- a/lib/find.rb
+++ b/lib/find.rb
@@ -36,7 +36,8 @@ module Find
paths.collect!{|d| d.dup}
while file = paths.shift
catch(:prune) do
- yield file
+ next unless File.exist? file
+ yield file.dup.taint
begin
if File.lstat(file).directory? then
d = Dir.open(file)
@@ -50,7 +51,7 @@ module Find
else
f = File.join(file, f)
end
- paths.unshift f
+ paths.unshift f.untaint
end
ensure
d.close