summaryrefslogtreecommitdiffstats
path: root/lib
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
commit81de6b9d54bf4fe0f7a7bd6bfb98ebd45a6b140e (patch)
treecefa0bf8401697624442bee31e5f6087a880b489 /lib
parent6e271da212126b58f586e005e2e50d0292b43e08 (diff)
downloadruby-81de6b9d54bf4fe0f7a7bd6bfb98ebd45a6b140e.tar.gz
ruby-81de6b9d54bf4fe0f7a7bd6bfb98ebd45a6b140e.tar.xz
ruby-81de6b9d54bf4fe0f7a7bd6bfb98ebd45a6b140e.zip
matz
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/find.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/find.rb b/lib/find.rb
index 9fb012902..a8dcea4f7 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