summaryrefslogtreecommitdiff
path: root/src/settings.cpp
diff options
context:
space:
mode:
authorCraig Robbins <kde.psych@gmail.com>2014-11-07 11:47:07 +1000
committerRealBadAngel <maciej.kasatkin@o2.pl>2014-11-08 21:57:52 +0100
commitcc8d7b86404f2830bcf09d04468e8041db276b98 (patch)
tree162381d99729cbb1acd6cbeb3d82dc863f3a7240 /src/settings.cpp
parent1c21e391edeb7739935ca78250f066a60c369fc7 (diff)
downloadminetest-cc8d7b86404f2830bcf09d04468e8041db276b98.tar.gz
minetest-cc8d7b86404f2830bcf09d04468e8041db276b98.tar.bz2
minetest-cc8d7b86404f2830bcf09d04468e8041db276b98.zip
Stop inserting empty lines at end of minetest.conf file each time it is rewritten
See: https://github.com/minetest/minetest/issues/1790
Diffstat (limited to 'src/settings.cpp')
-rw-r--r--src/settings.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/settings.cpp b/src/settings.cpp
index ca0775330..65896ef27 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -667,8 +667,9 @@ void Settings::getUpdatedConfigObject(std::istream &is,
bool &changed)
{
std::string name, value;
+
if (!parseConfigObject(is, name, value)) {
- dst.push_back(value + '\n');
+ dst.push_back(value + (is.eof() ? "" : "\n"));
return;
}
@@ -679,7 +680,7 @@ void Settings::getUpdatedConfigObject(std::istream &is,
changed = true;
}
- dst.push_back(name + " = " + new_value + '\n');
+ dst.push_back(name + " = " + new_value + (is.eof() ? "" : "\n"));
updated.insert(name);
} else { // File contains a setting which is not in m_settings
changed = true;