summaryrefslogtreecommitdiff
path: root/lib/find.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-09-21 09:31:00 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-09-21 09:31:00 +0000
commitb35df6aae27214f831931c0174afb497218cf74e (patch)
treecefa0bf8401697624442bee31e5f6087a880b489 /lib/find.rb
parent616c1cd971695ed74df6e3a98fa9d584f3783e8b (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/find.rb')
-rw-r--r--lib/find.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/find.rb b/lib/find.rb
index 9fb012902c..a8dcea4f71 100644
--- a/lib/find.rb
+++ b/lib/find.rb
@@ -12,17 +12,17 @@ module Find
while file = path.shift
catch(:prune) {
yield file
- if File.directory? file then
+ if File.lstat(file).directory? then
d = Dir.open(file)
begin
for f in d
- next if f =~ /\A\.\.?\z/
- if File::ALT_SEPARATOR and file =~ /^([\/\\]|[A-Za-z]:[\/\\]?)$/ then
+ next if f == "." or f == ".."
+ if File::ALT_SEPARATOR and file =~ /^(?:[\/\\]|[A-Za-z]:[\/\\]?)$/ then
f = file + f
elsif file == "/" then
f = "/" + f
else
- f = file + "/" + f
+ f = File.join(file, f)
end
path.unshift f
end