Project

General

Profile

Bug #9180 ยป diretory.patch

matsuda (Akira Matsuda), 11/30/2013 12:28 AM

View differences:

lib/fileutils.rb
when file?
copy_file dest
when directory?
if !File.exist?(dest) and descendant_diretory?(dest, path)
if !File.exist?(dest) and descendant_directory?(dest, path)
raise ArgumentError, "cannot copy directory %s to itself %s" % [path, dest]
end
begin
......
end
SYSCASE = File::FNM_SYSCASE.nonzero? ? "-i" : ""
def descendant_diretory?(descendant, ascendant)
def descendant_directory?(descendant, ascendant)
/\A(?#{SYSCASE}:#{Regexp.quote(ascendant)})#{DIRECTORY_TERM}/ =~ File.dirname(descendant)
end
end # class Entry_
    (1-1/1)