Skip to content

Commit

Permalink
Stop inserting empty lines at end of minetest.conf file each time it …
Browse files Browse the repository at this point in the history
…is rewritten

See: #1790
  • Loading branch information
Zeno- authored and RealBadAngel committed Nov 8, 2014
1 parent 1c21e39 commit cc8d7b8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/settings.cpp
Expand Up @@ -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;
}

Expand All @@ -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;
Expand Down

0 comments on commit cc8d7b8

Please sign in to comment.