[前][次][番号順一覧][スレッド一覧]

ruby-changes:35255

From: usa <ko1@a...>
Date: Sun, 31 Aug 2014 16:25:49 +0900 (JST)
Subject: [ruby-changes:35255] usa:r47337 (ruby_2_0_0): merge revision(s) 45827: [Backport #9618]

usa	2014-08-31 16:25:44 +0900 (Sun, 31 Aug 2014)

  New Revision: 47337

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=47337

  Log:
    merge revision(s) 45827: [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_0_0/
  Modified files:
    branches/ruby_2_0_0/ChangeLog
    branches/ruby_2_0_0/ext/pathname/lib/pathname.rb
    branches/ruby_2_0_0/test/pathname/test_pathname.rb
    branches/ruby_2_0_0/version.h
Index: ruby_2_0_0/ChangeLog
===================================================================
--- ruby_2_0_0/ChangeLog	(revision 47336)
+++ ruby_2_0_0/ChangeLog	(revision 47337)
@@ -1,3 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1
+Sun Aug 31 16:24:54 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.
+
 Sun Aug 31 16:23:41 2014  Naohisa Goto  <ngotogenome@g...>
 
 	* lib/fileutils.rb (rmdir): rescue Errno::EEXIST in addition to
Index: ruby_2_0_0/ext/pathname/lib/pathname.rb
===================================================================
--- ruby_2_0_0/ext/pathname/lib/pathname.rb	(revision 47336)
+++ ruby_2_0_0/ext/pathname/lib/pathname.rb	(revision 47337)
@@ -113,6 +113,7 @@ class Pathname https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/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_0_0/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_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 47336)
+++ ruby_2_0_0/version.h	(revision 47337)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1
 #define RUBY_VERSION "2.0.0"
 #define RUBY_RELEASE_DATE "2014-08-31"
-#define RUBY_PATCHLEVEL 537
+#define RUBY_PATCHLEVEL 538
 
 #define RUBY_RELEASE_YEAR 2014
 #define RUBY_RELEASE_MONTH 8
Index: ruby_2_0_0/test/pathname/test_pathname.rb
===================================================================
--- ruby_2_0_0/test/pathname/test_pathname.rb	(revision 47336)
+++ ruby_2_0_0/test/pathname/test_pathname.rb	(revision 47337)
@@ -88,6 +88,10 @@ class TestPathname < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/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_0_0/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_0_0
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r45827


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]