diff options
author | SmallJoker <mk939@ymail.com> | 2014-12-06 17:26:22 +0100 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2014-12-06 14:08:01 -0500 |
commit | d75f0b0360daeb81dd574756845160745dfecacd (patch) | |
tree | 1103e2bee4508b3178abf22f37d2c4fa2221a7f1 /src/settings.cpp | |
parent | 4fcf9fb66a54d0f72b7338a2668b04236e69cc16 (diff) | |
download | minetest-d75f0b0360daeb81dd574756845160745dfecacd.tar.gz minetest-d75f0b0360daeb81dd574756845160745dfecacd.tar.bz2 minetest-d75f0b0360daeb81dd574756845160745dfecacd.zip |
Close settings files and save them correctly
Diffstat (limited to 'src/settings.cpp')
-rw-r--r-- | src/settings.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/settings.cpp b/src/settings.cpp index 775c00699..fa7da806d 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -350,8 +350,11 @@ bool Settings::updateConfigFile(const char *filename) std::ifstream is(filename); std::ostringstream os(std::ios_base::binary); - - if (!updateConfigObject(is, os, "")) + + bool was_modified = updateConfigObject(is, os, ""); + is.close(); + + if (!was_modified) return true; if (!fs::safeWriteToFile(filename, os.str())) { |