From d718b0b34eda84744778fa12a01d5be5f03753d3 Mon Sep 17 00:00:00 2001 From: PilzAdam Date: Tue, 13 Aug 2013 19:15:06 +0200 Subject: Dont write directly to files but rather write and copy a tmp file --- src/settings.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/settings.h') diff --git a/src/settings.h b/src/settings.h index e7b49b6d7..a9e0faa40 100644 --- a/src/settings.h +++ b/src/settings.h @@ -36,6 +36,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include #include +#include "filesys.h" enum ValueType { @@ -308,14 +309,7 @@ public: // Write stuff back { - std::ofstream os(filename); - if(os.good() == false) - { - errorstream<<"Error opening configuration file" - " for writing: \"" - <second; infostream<<"Adding \""<