summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--version.h2
-rw-r--r--win32/win32.c11
3 files changed, 10 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 7cb2e1db8b..9b470f38aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/version.h b/version.h
index d2ba952e5e..b502ebad29 100644
--- a/version.h
+++ b/version.h
@@ -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