mirror of
https://github.com/minetest/minetest.git
synced 2024-12-12 09:23:15 +01:00
Close settings files and save them correctly
This commit is contained in:
parent
4fcf9fb66a
commit
d75f0b0360
@ -351,7 +351,10 @@ bool Settings::updateConfigFile(const char *filename)
|
|||||||
std::ifstream is(filename);
|
std::ifstream is(filename);
|
||||||
std::ostringstream os(std::ios_base::binary);
|
std::ostringstream os(std::ios_base::binary);
|
||||||
|
|
||||||
if (!updateConfigObject(is, os, ""))
|
bool was_modified = updateConfigObject(is, os, "");
|
||||||
|
is.close();
|
||||||
|
|
||||||
|
if (!was_modified)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (!fs::safeWriteToFile(filename, os.str())) {
|
if (!fs::safeWriteToFile(filename, os.str())) {
|
||||||
|
Loading…
Reference in New Issue
Block a user