From e2c4dc8249f6f0de0ce80bb461a63a337d21622c Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Fri, 10 May 2019 13:27:29 -0400 Subject: [PATCH] Remove old patch before moving new temporary patch to its location. --- src/patch.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/patch.cpp b/src/patch.cpp index fc0eda6a..69840655 100644 --- a/src/patch.cpp +++ b/src/patch.cpp @@ -91,6 +91,7 @@ void PatchManager::save(std::string path) { json_dumpf(rootJ, file, JSON_INDENT(2) | JSON_REAL_PRECISION(9)); std::fclose(file); + std::remove(path.c_str()); std::rename(tmpPath.c_str(), path.c_str()); }