Fixed that copy operation fails on XP if from path ends with path separator

This commit is contained in:
spx 2013-03-18 20:29:03 +09:00
parent 5d6794ce7b
commit 5252c95fd6

View File

@ -1216,6 +1216,13 @@ void CSystem::SetWallpaper(const std::wstring& wallpaper, const std::wstring& st
*/
bool CSystem::CopyFiles(std::wstring from, std::wstring to, bool bMove)
{
// If given "from" path ends with path separator, remove it (Workaround for XP: error code 1026)
size_t len;
while (len = from.size(), len > 0 && IsPathSeparator(from[len - 1]))
{
from.resize(len - 1);
}
// The strings must end with double \0
from.append(1, L'\0');
to.append(1, L'\0');