[BUG_FIXED] (Author: Andreas Jonsson) Fix rename not replacing the existing file.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1184 f5eea248-9336-0410-98b8-ebc06183d4e3
remotes/trunk
Don Ho 11 years ago
parent 7ce969dc74
commit 36fd69ee59

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

Loading…
Cancel
Save