From 699242b1a715bcef71c387832a5ae557f0e71ae9 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Thu, 24 Sep 2020 22:16:23 +1000 Subject: [PATCH] GameList: Fix compatibility xml saving --- src/frontend-common/game_list.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/frontend-common/game_list.cpp b/src/frontend-common/game_list.cpp index 26a52b251..6e02ae6e3 100644 --- a/src/frontend-common/game_list.cpp +++ b/src/frontend-common/game_list.cpp @@ -1039,7 +1039,12 @@ bool GameList::SaveCompatibilityDatabaseForEntry(const GameListCompatibilityEntr InitElementForCompatibilityEntry(&doc, entry_elem, entry); } - error = doc.SaveFile(m_compatibility_list_filename.c_str()); + fp.reset(); + fp = FileSystem::OpenManagedCFile(m_compatibility_list_filename.c_str(), "wb"); + if (!fp) + return SaveCompatibilityDatabase(); + + error = doc.SaveFile(fp.get()); if (error != tinyxml2::XML_SUCCESS) { Log_ErrorPrintf("Failed to update compatibility list '%s': %s", m_compatibility_list_filename.c_str(),