ruby-changes:47125
From: usa <ko1@a...>
Date: Fri, 30 Jun 2017 22:01:35 +0900 (JST)
Subject: [ruby-changes:47125] usa:r59240 (ruby_2_3): merge revision(s) 59102: [Backport #13515]
usa 2017-06-30 22:01:26 +0900 (Fri, 30 Jun 2017) New Revision: 59240 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59240 Log: 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] Modified directories: branches/ruby_2_3/ Modified files: branches/ruby_2_3/ChangeLog branches/ruby_2_3/ext/pathname/lib/pathname.rb branches/ruby_2_3/test/pathname/test_pathname.rb branches/ruby_2_3/version.h Index: ruby_2_3/version.h =================================================================== --- ruby_2_3/version.h (revision 59239) +++ ruby_2_3/version.h (revision 59240) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1 #define RUBY_VERSION "2.3.5" #define RUBY_RELEASE_DATE "2017-06-30" -#define RUBY_PATCHLEVEL 336 +#define RUBY_PATCHLEVEL 337 #define RUBY_RELEASE_YEAR 2017 #define RUBY_RELEASE_MONTH 6 Index: ruby_2_3/test/pathname/test_pathname.rb =================================================================== --- ruby_2_3/test/pathname/test_pathname.rb (revision 59239) +++ ruby_2_3/test/pathname/test_pathname.rb (revision 59240) @@ -14,8 +14,8 @@ class TestPathname < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/ruby_2_3/test/pathname/test_pathname.rb#L14 end def self.get_linenum - if /:(\d+):/ =~ caller[1] - $1.to_i + if loc = caller_locations(2, 1) + loc[0].lineno else nil end @@ -221,6 +221,8 @@ class TestPathname < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/ruby_2_3/test/pathname/test_pathname.rb#L221 defassert(:plus, 'a//b/d//e', 'a//b/c', '../d//e') + defassert(:plus, '//foo/var/bar', '//foo/var', 'bar') + def test_slash assert_kind_of(Pathname, Pathname("a") / Pathname("b")) end Index: ruby_2_3/ext/pathname/lib/pathname.rb =================================================================== --- ruby_2_3/ext/pathname/lib/pathname.rb (revision 59239) +++ ruby_2_3/ext/pathname/lib/pathname.rb (revision 59240) @@ -378,7 +378,7 @@ class Pathname https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/pathname/lib/pathname.rb#L378 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 Index: ruby_2_3/ChangeLog =================================================================== --- ruby_2_3/ChangeLog (revision 59239) +++ ruby_2_3/ChangeLog (revision 59240) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ChangeLog#L1 +Fri Jun 30 22:00:56 2017 Nobuyoshi Nakada <nobu@r...> + + * 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. [Bug #13515] + Fri Jun 30 21:57:27 2017 Kouhei Sutou <kou@c...> * lib/rexml/parsers/streamparser.rb: add close tag check on end of Index: ruby_2_3 =================================================================== --- ruby_2_3 (revision 59239) +++ ruby_2_3 (revision 59240) Property changes on: ruby_2_3 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /trunk:r59102 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/