fix: Make sure files don't get truncated when using Save As on itself

Fixes #987
This commit is contained in:
WerWolv
2023-03-21 15:42:10 +01:00
parent b9059aaa01
commit be16b66ac0
2 changed files with 8 additions and 0 deletions

View File

@@ -84,6 +84,13 @@ namespace hex::plugin::builtin {
this->applyPatches();
}
void FileProvider::saveAs(const std::fs::path &path) {
if (path == this->m_path)
this->save();
else
Provider::saveAs(path);
}
void FileProvider::resize(size_t newSize) {
this->close();