ruby-changes:34828
From: nagachika <ko1@a...>
Date: Wed, 23 Jul 2014 23:05:44 +0900 (JST)
Subject: [ruby-changes:34828] nagachika:r46911 (ruby_2_1): merge revision(s) r45827: [Backport #9618]
nagachika 2014-07-23 23:05:38 +0900 (Wed, 23 Jul 2014) New Revision: 46911 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46911 Log: merge revision(s) r45827: [Backport #9618] * ext/pathname/lib/pathname.rb (cleanpath_aggressive): make all separators File::SEPARATOR from File::ALT_SEPARATOR. Reported by Daniel Rikowski. Fixed by Nobuyoshi Nakada. [Bug #9618] * ext/pathname/lib/pathname.rb (cleanpath_conservative): ditto. Modified directories: branches/ruby_2_1/ Modified files: branches/ruby_2_1/ChangeLog branches/ruby_2_1/ext/pathname/lib/pathname.rb branches/ruby_2_1/test/pathname/test_pathname.rb branches/ruby_2_1/version.h Index: ruby_2_1/ChangeLog =================================================================== --- ruby_2_1/ChangeLog (revision 46910) +++ ruby_2_1/ChangeLog (revision 46911) @@ -1,3 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1 +Wed Jul 23 23:05:19 2014 Tanaka Akira <akr@f...> + + * ext/pathname/lib/pathname.rb (cleanpath_aggressive): make all + separators File::SEPARATOR from File::ALT_SEPARATOR. + Reported by Daniel Rikowski. + Fixed by Nobuyoshi Nakada. [Bug #9618] + + * ext/pathname/lib/pathname.rb (cleanpath_conservative): ditto. + Wed Jul 23 22:51:34 2014 Naohisa Goto <ngotogenome@g...> * lib/fileutils.rb (rmdir): rescue Errno::EEXIST in addition to Index: ruby_2_1/ext/pathname/lib/pathname.rb =================================================================== --- ruby_2_1/ext/pathname/lib/pathname.rb (revision 46910) +++ ruby_2_1/ext/pathname/lib/pathname.rb (revision 46911) @@ -113,6 +113,7 @@ class Pathname https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ext/pathname/lib/pathname.rb#L113 end end end + pre.tr!(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR if /#{SEPARATOR_PAT}/o =~ File.basename(pre) names.shift while names[0] == '..' end @@ -161,6 +162,7 @@ class Pathname https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ext/pathname/lib/pathname.rb#L162 pre, base = r names.unshift base if base != '.' end + pre.tr!(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR if /#{SEPARATOR_PAT}/o =~ File.basename(pre) names.shift while names[0] == '..' end Index: ruby_2_1/version.h =================================================================== --- ruby_2_1/version.h (revision 46910) +++ ruby_2_1/version.h (revision 46911) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1 #define RUBY_VERSION "2.1.2" #define RUBY_RELEASE_DATE "2014-07-23" -#define RUBY_PATCHLEVEL 179 +#define RUBY_PATCHLEVEL 180 #define RUBY_RELEASE_YEAR 2014 #define RUBY_RELEASE_MONTH 7 Index: ruby_2_1/test/pathname/test_pathname.rb =================================================================== --- ruby_2_1/test/pathname/test_pathname.rb (revision 46910) +++ ruby_2_1/test/pathname/test_pathname.rb (revision 46911) @@ -88,6 +88,10 @@ class TestPathname < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/ruby_2_1/test/pathname/test_pathname.rb#L88 defassert(:cleanpath_aggressive, '/', '///a/../..') end + if DOSISH + defassert(:cleanpath_aggressive, 'c:/foo/bar', 'c:\\foo\\bar') + end + def cleanpath_conservative(path) Pathname.new(path).cleanpath(true).to_s end @@ -124,6 +128,10 @@ class TestPathname < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/ruby_2_1/test/pathname/test_pathname.rb#L128 defassert(:cleanpath_conservative, '/a', '/../.././../a') defassert(:cleanpath_conservative, 'a/b/../../../../c/../d', 'a/b/../../../../c/../d') + if DOSISH + defassert(:cleanpath_conservative, 'c:/foo/bar', 'c:\\foo\\bar') + end + if DOSISH_UNC defassert(:cleanpath_conservative, '//', '//') else Property changes on: ruby_2_1 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r45827 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/