From 81de6b9d54bf4fe0f7a7bd6bfb98ebd45a6b140e Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 21 Sep 2000 09:31:00 +0000 Subject: matz git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/find.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') 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 -- cgit