From fdacdcae073f13e867a5a79799de95283bf0ad8e Mon Sep 17 00:00:00 2001 From: Vladimir Perminov Date: Thu, 17 Sep 2015 22:36:43 +0300 Subject: [PATCH] FileUtilsWin32 removeDirectory correct remove file begins with point Need check fileName . and .. for delete folders and files begin name. --- cocos/platform/win32/CCFileUtils-win32.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cocos/platform/win32/CCFileUtils-win32.cpp b/cocos/platform/win32/CCFileUtils-win32.cpp index c890faf2cf..e9a78c2d4a 100644 --- a/cocos/platform/win32/CCFileUtils-win32.cpp +++ b/cocos/platform/win32/CCFileUtils-win32.cpp @@ -592,8 +592,9 @@ bool FileUtilsWin32::removeDirectory(const std::string& dirPath) BOOL find = true; while (find) { - //. .. - if (wfd.cFileName[0] != '.') + // Need check string . and .. for delete folders and files begin name. + std::wstring fileName = wfd.cFileName; + if (fileName != L"." && fileName != L"..") { std::wstring temp = wpath + wfd.cFileName; if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)