Skip to content

Commit

Permalink
Merge pull request #743 from planet36/config-trailing-newline
Browse files Browse the repository at this point in the history
  • Loading branch information
aristocratos committed Feb 11, 2024
2 parents 77c758c + c7fdd8a commit c587c9f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/btop_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -732,16 +732,17 @@ namespace Config {
if (geteuid() != Global::real_uid and seteuid(Global::real_uid) != 0) return;
std::ofstream cwrite(conf_file, std::ios::trunc);
if (cwrite.good()) {
cwrite << "#? Config file for btop v. " << Global::Version;
cwrite << "#? Config file for btop v. " << Global::Version << "\n";
for (auto [name, description] : descriptions) {
cwrite << "\n\n" << (description.empty() ? "" : description + "\n")
cwrite << "\n" << (description.empty() ? "" : description + "\n")
<< name << " = ";
if (strings.contains(name))
cwrite << "\"" << strings.at(name) << "\"";
else if (ints.contains(name))
cwrite << ints.at(name);
else if (bools.contains(name))
cwrite << (bools.at(name) ? "True" : "False");
cwrite << "\n";
}
}
}
Expand Down

0 comments on commit c587c9f

Please sign in to comment.