ruby-changes:26264
From: usa <ko1@a...>
Date: Tue, 11 Dec 2012 19:20:00 +0900 (JST)
Subject: [ruby-changes:26264] usa:r38321 (ruby_1_9_3): merge revision(s) 37692,37700,37706: [Backport #7381]
usa 2012-12-11 19:19:51 +0900 (Tue, 11 Dec 2012) New Revision: 38321 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38321 Log: merge revision(s) 37692,37700,37706: [Backport #7381] * win32/file.c (replace_to_long_name): skip automatic path expansion when wildcard character is used. [ruby-core:49451] [Bug #7374] * test/ruby/test_file_exhaustive.rb: add a test for above. * win32/file.c (replace_to_long_name): skip expansion for all wildcard characters. [ruby-core:49451] [Bug #7374] * test/ruby/test_file_exhaustive.rb: add more assertions to test. * win32/file.c (replace_to_long_name): correct logic around wildcard characters detection and ensure wide-chars are used as pattern. [ruby-core:49451] [Bug #7374] Modified directories: branches/ruby_1_9_3/ Modified files: branches/ruby_1_9_3/ChangeLog branches/ruby_1_9_3/test/ruby/test_file_exhaustive.rb branches/ruby_1_9_3/version.h branches/ruby_1_9_3/win32/file.c Index: ruby_1_9_3/ChangeLog =================================================================== --- ruby_1_9_3/ChangeLog (revision 38320) +++ ruby_1_9_3/ChangeLog (revision 38321) @@ -1,3 +1,24 @@ +Tue Dec 11 19:19:33 2012 Luis Lavena <luislavena@g...> + + * win32/file.c (replace_to_long_name): correct logic around wildcard + characters detection and ensure wide-chars are used as pattern. + [ruby-core:49451] [Bug #7374] + +Sat Nov 17 21:45:12 Luis Lavena <luislavena@g...> + + * win32/file.c (replace_to_long_name): skip expansion for all wildcard + characters. + [ruby-core:49451] [Bug #7374] + + * test/ruby/test_file_exhaustive.rb: add more assertions to test. + +Tue Dec 11 19:19:33 2012 Luis Lavena <luislavena@g...> + + * win32/file.c (replace_to_long_name): skip automatic path expansion + when wildcard character is used. [ruby-core:49451] [Bug #7374] + + * test/ruby/test_file_exhaustive.rb: add a test for above. + Tue Dec 11 19:18:12 2012 NAKAMURA Usaku <usa@r...> * win32/mkexports.rb (each_export): skip garbages generated by VS2012's Index: ruby_1_9_3/win32/file.c =================================================================== --- ruby_1_9_3/win32/file.c (revision 38320) +++ ruby_1_9_3/win32/file.c (revision 38321) @@ -276,6 +276,11 @@ return size; } + /* skip long name conversion if path contains wildcard characters */ + if (wcspbrk(pos, L"*?")) { + return size; + } + pos = *wfullpath + size - 1; while (!IS_DIR_SEPARATOR_P(*pos) && pos != *wfullpath) { if (!extension_len && *pos == L'.') { Index: ruby_1_9_3/version.h =================================================================== --- ruby_1_9_3/version.h (revision 38320) +++ ruby_1_9_3/version.h (revision 38321) @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.3" -#define RUBY_PATCHLEVEL 339 +#define RUBY_PATCHLEVEL 340 #define RUBY_RELEASE_DATE "2012-12-11" #define RUBY_RELEASE_YEAR 2012 Index: ruby_1_9_3/test/ruby/test_file_exhaustive.rb =================================================================== --- ruby_1_9_3/test/ruby/test_file_exhaustive.rb (revision 38320) +++ ruby_1_9_3/test/ruby/test_file_exhaustive.rb (revision 38321) @@ -601,6 +601,13 @@ assert_equal("#{DRIVE}/dir", File.expand_path("#{DRIVE}/./dir")) end + def test_expand_path_does_not_expand_wildcards + assert_equal("#{DRIVE}/*", File.expand_path("./*", "#{DRIVE}/")) + assert_equal("#{Dir.pwd}/*", File.expand_path("./*", Dir.pwd)) + assert_equal("#{DRIVE}/?", File.expand_path("./?", "#{DRIVE}/")) + assert_equal("#{Dir.pwd}/?", File.expand_path("./?", Dir.pwd)) + end if DRIVE + def test_expand_path_does_not_modify_the_string_argument str = "./a/b/../c" assert_equal("#{Dir.pwd}/a/c", File.expand_path(str, Dir.pwd)) Property changes on: ruby_1_9_3 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r37692,37700,37706 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/