fix: Make sure files don't get truncated when using Save As on itself
Fixes #987
This commit is contained in:
parent
b9059aaa01
commit
be16b66ac0
@ -32,6 +32,7 @@ namespace hex::plugin::builtin {
|
||||
[[nodiscard]] size_t getActualSize() const override;
|
||||
|
||||
void save() override;
|
||||
void saveAs(const std::fs::path &path) override;
|
||||
|
||||
[[nodiscard]] std::string getName() const override;
|
||||
[[nodiscard]] std::vector<std::pair<std::string, std::string>> getDataDescription() const override;
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user