From 36fd69ee595148776af6e4089bc7f0e525a967d6 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Fri, 21 Feb 2014 08:11:48 +0000 Subject: [PATCH] [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 --- PowerEditor/src/ScitillaComponent/Buffer.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/PowerEditor/src/ScitillaComponent/Buffer.cpp b/PowerEditor/src/ScitillaComponent/Buffer.cpp index 642ec022..1513e919 100644 --- a/PowerEditor/src/ScitillaComponent/Buffer.cpp +++ b/PowerEditor/src/ScitillaComponent/Buffer.cpp @@ -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);