diff --git a/Library/Measure.cpp b/Library/Measure.cpp index 9b97457b..fcc12ac6 100644 --- a/Library/Measure.cpp +++ b/Library/Measure.cpp @@ -254,7 +254,7 @@ const WCHAR* CMeasure::CheckSubstitute(const WCHAR* buffer) if (re == NULL) { MakePlainSubstitute(str, i); - LogWithArgs(LOG_NOTICE, L"%S", error); + LogWithArgs(LOG_NOTICE, L"Substitute: %S", error); } else { diff --git a/Library/System.cpp b/Library/System.cpp index bd2cc453..8b86970a 100644 --- a/Library/System.cpp +++ b/Library/System.cpp @@ -1230,27 +1230,25 @@ void CSystem::SetWallpaper(const std::wstring& wallpaper, const std::wstring& st ** Copies files and folders from one location to another. ** */ -bool CSystem::CopyFiles(const std::wstring& strFrom, const std::wstring& strTo, bool bMove) +bool CSystem::CopyFiles(std::wstring from, std::wstring to, bool bMove) { - std::wstring tmpFrom(strFrom), tmpTo(strTo); - - // The strings must end with double nul - tmpFrom.append(1, L'\0'); - tmpTo.append(1, L'\0'); + // The strings must end with double \0 + from.append(1, L'\0'); + to.append(1, L'\0'); SHFILEOPSTRUCT fo = { NULL, bMove ? FO_MOVE : FO_COPY, - tmpFrom.c_str(), - tmpTo.c_str(), + from.c_str(), + to.c_str(), FOF_NO_UI | FOF_NOCONFIRMATION | FOF_ALLOWUNDO }; int result = SHFileOperation(&fo); if (result != 0) { - LogWithArgs(LOG_ERROR, L"Unable to copy files from %s to %s (%i)", strFrom.c_str(), strTo.c_str(), result); + LogWithArgs(LOG_ERROR, L"Copy error: From %s to %s (%i)", from.c_str(), to.c_str(), result); return false; } return true; diff --git a/Library/System.h b/Library/System.h index 2a80d1b9..1c78a174 100644 --- a/Library/System.h +++ b/Library/System.h @@ -82,7 +82,7 @@ public: static void SetClipboardText(const std::wstring& text); static void SetWallpaper(const std::wstring& wallpaper, const std::wstring& style); - static bool CopyFiles(const std::wstring& strFrom, const std::wstring& strTo, bool bMove = false); + static bool CopyFiles(std::wstring from, std::wstring to, bool bMove = false); static bool RemoveFile(const std::wstring& file); static bool RemoveFolder(const std::wstring& strFolder);