From b11cf1fa106a6624900182197e58672c4a2371dc Mon Sep 17 00:00:00 2001 From: comex Date: Tue, 15 Oct 2013 17:20:00 -0400 Subject: [PATCH] Fix config file saving on Windows. --- Source/Core/Common/Src/FileUtil.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp index 441c8ce405..2d143787d7 100644 --- a/Source/Core/Common/Src/FileUtil.cpp +++ b/Source/Core/Common/Src/FileUtil.cpp @@ -244,16 +244,16 @@ bool Rename(const std::string &srcFilename, const std::string &destFilename) INFO_LOG(COMMON, "Rename: %s --> %s", srcFilename.c_str(), destFilename.c_str()); #ifdef _WIN32 - auto sf = UTF8ToTStr(srcFilename).c_str(); - auto df = UTF8ToTStr(destFilename).c_str(); + auto sf = UTF8ToTStr(srcFilename); + auto df = UTF8ToTStr(destFilename); // The Internet seems torn about whether ReplaceFile is atomic or not. // Hopefully it's atomic enough... - if (ReplaceFile(df, sf, NULL, REPLACEFILE_IGNORE_MERGE_ERRORS, NULL, NULL)) + if (ReplaceFile(df.c_str(), sf.c_str(), NULL, REPLACEFILE_IGNORE_MERGE_ERRORS, NULL, NULL)) return true; // Might have failed because the destination doesn't exist. if (GetLastError() == ERROR_FILE_NOT_FOUND) { - if (MoveFile(sf, df)) + if (MoveFile(sf.c_str(), df.c_str())) return true; } #else