mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
* lib/fileutils.rb (remove_dir): should handle symlink correctly. This patch is contributed by Christian Loew. [ruby-talk:94635] (Backport from main trunk)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
692cc24339
commit
4c99df4180
2 changed files with 9 additions and 1 deletions
|
@ -581,7 +581,9 @@ module FileUtils
|
|||
Dir.foreach(dir) do |file|
|
||||
next if /\A\.\.?\z/ === file
|
||||
path = "#{dir}/#{file}"
|
||||
if File.directory?(path)
|
||||
if File.symlink?(path)
|
||||
remove_file path, force
|
||||
elsif File.directory?(path)
|
||||
remove_dir path, force
|
||||
else
|
||||
remove_file path, force
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue