[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
This commit is contained in:
parent
7ce969dc74
commit
36fd69ee59
@ -604,10 +604,7 @@ bool FileManager::moveFile(BufferID id, const TCHAR * newFileName)
|
|||||||
{
|
{
|
||||||
Buffer * buf = getBufferByID(id);
|
Buffer * buf = getBufferByID(id);
|
||||||
const TCHAR *fileNamePath = buf->getFullPathName();
|
const TCHAR *fileNamePath = buf->getFullPathName();
|
||||||
if (!PathFileExists(fileNamePath))
|
if (::MoveFileEx(fileNamePath, newFileName, MOVEFILE_REPLACE_EXISTING) == 0)
|
||||||
return false;
|
|
||||||
|
|
||||||
if (::MoveFile(fileNamePath, newFileName) == 0)
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
buf->setFileName(newFileName);
|
buf->setFileName(newFileName);
|
||||||
|
Loading…
Reference in New Issue
Block a user