ruby-changes:37559
From: nobu <ko1@a...>
Date: Thu, 19 Feb 2015 01:58:28 +0900 (JST)
Subject: [ruby-changes:37559] nobu:r49640 (trunk): win32/file.c: fix drive letter
nobu 2015-02-19 01:58:13 +0900 (Thu, 19 Feb 2015) New Revision: 49640 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49640 Log: win32/file.c: fix drive letter * win32/file.c (rb_file_expand_path_internal): neither the drive of base directory nor the current drive are involved in the result if different than the drive of path. [ruby-core:68130] [Bug #10858] Modified files: trunk/ChangeLog trunk/test/ruby/test_file_exhaustive.rb trunk/win32/file.c Index: ChangeLog =================================================================== --- ChangeLog (revision 49639) +++ ChangeLog (revision 49640) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu Feb 19 01:58:10 2015 Nobuyoshi Nakada <nobu@r...> + + * win32/file.c (rb_file_expand_path_internal): neither the drive + of base directory nor the current drive are involved in the + result if different than the drive of path. + [ruby-core:68130] [Bug #10858] + Wed Feb 18 10:48:56 2015 Nobuyoshi Nakada <nobu@r...> * win32/win32.c (wrename): return EXDEV if moving a directory to Index: win32/file.c =================================================================== --- win32/file.c (revision 49639) +++ win32/file.c (revision 49640) @@ -501,6 +501,7 @@ rb_file_expand_path_internal(VALUE fname https://github.com/ruby/ruby/blob/trunk/win32/file.c#L501 /* ignore dir since path drive is different from dir drive */ ignore_dir = 1; wdir_len = 0; + dir_drive = 0; } } Index: test/ruby/test_file_exhaustive.rb =================================================================== --- test/ruby/test_file_exhaustive.rb (revision 49639) +++ test/ruby/test_file_exhaustive.rb (revision 49640) @@ -447,6 +447,7 @@ class TestFileExhaustive < Test::Unit::T https://github.com/ruby/ruby/blob/trunk/test/ruby/test_file_exhaustive.rb#L447 assert_equal(@file, File.expand_path(@file + "::$DATA")) assert_match(/\Ac:\//i, File.expand_path('c:'), '[ruby-core:31591]') assert_match(/\Ac:\//i, File.expand_path('c:foo', 'd:/bar')) + assert_match(/\Ae:\//i, File.expand_path('e:foo', 'd:/bar')) assert_match(%r'\Ac:/bar/foo\z'i, File.expand_path('c:foo', 'c:/bar')) when /darwin/ ["\u{feff}", *"\u{2000}"..."\u{2100}"].each do |c| -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/