summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-07-23 07:36:10 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-07-23 07:36:10 +0000
commite52f95a68a1c596d010d9cd3cc5f98177e71eb27 (patch)
treeb45e661c58f8ec901ea2cbd6f74aae37762b394d /ext
parent3fd2cbecff6f9c3e7dbb3bc171b4321266ff183f (diff)
merge revision(s) 59102: [Backport #13515]
pathname.rb: UNC root pathname needs a separator * ext/pathname/lib/pathname.rb (Pathname#plus): UNC root pathname needs a separator. File.basename returns "/" on UNC root, as well as sole drive letter, even if it does not end with a separator. [ruby-core:80900] [Bug #13515] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@59400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/pathname/lib/pathname.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/pathname/lib/pathname.rb b/ext/pathname/lib/pathname.rb
index a6621565d0..8bdb73f439 100644
--- a/ext/pathname/lib/pathname.rb
+++ b/ext/pathname/lib/pathname.rb
@@ -378,7 +378,7 @@ class Pathname
basename_list2.shift
end
r1 = chop_basename(prefix1)
- if !r1 && /#{SEPARATOR_PAT}/o =~ File.basename(prefix1)
+ if !r1 && (r1 = /#{SEPARATOR_PAT}/o =~ File.basename(prefix1))
while !basename_list2.empty? && basename_list2.first == '..'
index_list2.shift
basename_list2.shift