fixes #4764, fixes #4731, fixes #4724

This commit is contained in:
Araq 2016-09-14 19:57:14 +02:00
commit 6a1b8e691f
5 changed files with 14 additions and 9 deletions

View file

@ -580,9 +580,9 @@ proc moveFile*(source, dest: string) {.rtl, extern: "nos$1",
when useWinUnicode:
let s = newWideCString(source)
let d = newWideCString(dest)
if moveFileW(s, d, 0'i32) == 0'i32: raiseOSError(osLastError())
if moveFileW(s, d) == 0'i32: raiseOSError(osLastError())
else:
if moveFileA(source, dest, 0'i32) == 0'i32: raiseOSError(osLastError())
if moveFileA(source, dest) == 0'i32: raiseOSError(osLastError())
else:
if c_rename(source, dest) != 0'i32:
raiseOSError(osLastError(), $strerror(errno))