Fix File-Rename failing when new name is on a different drive

Fix #1978, close #6111
This commit is contained in:
Scott Sumner 2019-08-29 15:29:28 -04:00 committed by Don HO
parent 34159ced7a
commit 797fdc340d
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E

View File

@ -747,7 +747,7 @@ bool FileManager::moveFile(BufferID id, const TCHAR * newFileName)
{
Buffer* buf = getBufferByID(id);
const TCHAR *fileNamePath = buf->getFullPathName();
if (::MoveFileEx(fileNamePath, newFileName, MOVEFILE_REPLACE_EXISTING) == 0)
if (::MoveFileEx(fileNamePath, newFileName, MOVEFILE_REPLACE_EXISTING | MOVEFILE_COPY_ALLOWED) == 0)
return false;
buf->setFileName(newFileName);