ruby-changes:30381
From: usa <ko1@a...>
Date: Fri, 9 Aug 2013 15:53:45 +0900 (JST)
Subject: [ruby-changes:30381] usa:r42460 (ruby_1_9_3): merge revision(s) 40001: [Backport #8609]
usa 2013-08-09 15:53:33 +0900 (Fri, 09 Aug 2013) New Revision: 42460 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42460 Log: merge revision(s) 40001: [Backport #8609] * win32/win32.c (wrename): use MoveFileExW instead of MoveFileW, because the latter fails on cross device file move of some environments. fix [ruby-core:53492] [Bug #8109] reported by mitchellh (Mitchell Hashimoto) Modified directories: branches/ruby_1_9_3/ Modified files: branches/ruby_1_9_3/ChangeLog branches/ruby_1_9_3/version.h branches/ruby_1_9_3/win32/win32.c Index: ruby_1_9_3/ChangeLog =================================================================== --- ruby_1_9_3/ChangeLog (revision 42459) +++ ruby_1_9_3/ChangeLog (revision 42460) @@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/ChangeLog#L1 +Fri Aug 9 15:50:11 2013 NAKAMURA Usaku <usa@r...> + + * win32/win32.c (wrename): use MoveFileExW instead of MoveFileW, + because the latter fails on cross device file move of some + environments. + fix [ruby-core:53492] [Bug #8109] + reported by mitchellh (Mitchell Hashimoto) + Thu Aug 8 16:09:26 2013 NAKAMURA Usaku <usa@r...> * test/coverage/test_coverage.rb (TestCoverage#test_big_code): use `1' Index: ruby_1_9_3/win32/win32.c =================================================================== --- ruby_1_9_3/win32/win32.c (revision 42459) +++ ruby_1_9_3/win32/win32.c (revision 42460) @@ -4023,18 +4023,18 @@ wrename(const WCHAR *oldpath, const WCHA https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/win32/win32.c#L4023 if (newatts != -1 && newatts & FILE_ATTRIBUTE_READONLY) SetFileAttributesW(newpath, newatts & ~ FILE_ATTRIBUTE_READONLY); - if (!MoveFileW(oldpath, newpath)) - res = -1; + if (IsWinNT()) { + if (!MoveFileExW(oldpath, newpath, MOVEFILE_REPLACE_EXISTING | MOVEFILE_COPY_ALLOWED)) + res = -1; + } + else { + if (!MoveFileW(oldpath, newpath)) + res = -1; - if (res) { - switch (GetLastError()) { - case ERROR_ALREADY_EXISTS: - case ERROR_FILE_EXISTS: - if (IsWinNT()) { - if (MoveFileExW(oldpath, newpath, MOVEFILE_REPLACE_EXISTING)) - res = 0; - } - else { + if (res) { + switch (GetLastError()) { + case ERROR_ALREADY_EXISTS: + case ERROR_FILE_EXISTS: for (;;) { if (!DeleteFileW(newpath) && GetLastError() != ERROR_FILE_NOT_FOUND) break; Index: ruby_1_9_3/version.h =================================================================== --- ruby_1_9_3/version.h (revision 42459) +++ ruby_1_9_3/version.h (revision 42460) @@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/version.h#L1 #define RUBY_VERSION "1.9.3" -#define RUBY_PATCHLEVEL 460 +#define RUBY_PATCHLEVEL 461 #define RUBY_RELEASE_DATE "2013-08-09" #define RUBY_RELEASE_YEAR 2013 Property changes on: ruby_1_9_3 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r40001 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/