diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | version.h | 2 | ||||
-rw-r--r-- | win32/win32.c | 11 |
3 files changed, 10 insertions, 11 deletions
@@ -1,3 +1,11 @@ +Sun Aug 4 22:42:16 2013 NAKAMURA Usaku <usa@ruby-lang.org> + + * 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) + Sat Aug 3 23:02:09 2013 Tanaka Akira <akr@fsij.org> * ext/extmk.rb (extmake): Invoke Logging::log_close in a ensure @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.0.0" #define RUBY_RELEASE_DATE "2013-08-04" -#define RUBY_PATCHLEVEL 289 +#define RUBY_PATCHLEVEL 290 #define RUBY_RELEASE_YEAR 2013 #define RUBY_RELEASE_MONTH 8 diff --git a/win32/win32.c b/win32/win32.c index 7e151d498e..c284194577 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -4344,18 +4344,9 @@ wrename(const WCHAR *oldpath, const WCHAR *newpath) if (newatts != -1 && newatts & FILE_ATTRIBUTE_READONLY) SetFileAttributesW(newpath, newatts & ~ FILE_ATTRIBUTE_READONLY); - if (!MoveFileW(oldpath, newpath)) + if (!MoveFileExW(oldpath, newpath, MOVEFILE_REPLACE_EXISTING | MOVEFILE_COPY_ALLOWED)) res = -1; - if (res) { - switch (GetLastError()) { - case ERROR_ALREADY_EXISTS: - case ERROR_FILE_EXISTS: - if (MoveFileExW(oldpath, newpath, MOVEFILE_REPLACE_EXISTING)) - res = 0; - } - } - if (res) errno = map_errno(GetLastError()); else |