diff options
author | Justin Collins <[email protected]> | 2016-09-11 02:09:43 -0700 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2019-08-06 09:01:04 +0900 |
commit | 4f1a00a746b8c47dd32f06b249aad8c4d27cb934 () | |
tree | 56aa77ce552f4f001410423a76bffdad075781fa /lib/fileutils.rb | |
parent | 96cec6b27741cbdeb51ea3acdeba0e813d51035f (diff) |
Improve same directory detection in FileUtils
Closes: https://.com/ruby/ruby/pull/1425
-rw-r--r-- | lib/fileutils.rb | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1546,10 +1546,13 @@ module FileUtils else DIRECTORY_TERM = "(?=/|\\z)" end - SYSCASE = File::FNM_SYSCASE.nonzero? ? "-i" : "" def descendant_directory?(descendant, ascendant) - /\A(?#{SYSCASE}:#{Regexp.quote(ascendant)})#{DIRECTORY_TERM}/ =~ File.dirname(descendant) end end # class Entry_ |