Permalink
Browse files

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

…arator
  • Loading branch information...
1 parent 5d6794c commit 5252c95fd6c37ca0dfec18d49588bbbbf68e64be @spx268 spx268 committed Mar 18, 2013
Showing with 7 additions and 0 deletions.
  1. +7 −0 Library/System.cpp
View
@@ -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');

0 comments on commit 5252c95

Please sign in to comment.