From 4c8aaaab1c38ecb8083863592ed70858ce16e028 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 19 Dec 2022 20:04:40 +0200 Subject: [PATCH] Use DataFile::Writer to write package configuration files --- source/config.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/config.cpp b/source/config.cpp index 67f932f..4e57fdf 100644 --- a/source/config.cpp +++ b/source/config.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -81,9 +82,10 @@ void Config::save() const package.get_builder().get_logger().log("files", format("Writing %s", fn)); IO::BufferedFile out(fn.str(), IO::M_WRITE); + DataFile::Writer writer(out); for(const auto &kvp: options) - IO::print(out, "option \"%s\" \"%s\";\n", kvp.second.name, kvp.second.value); + writer.write((DataFile::Statement("option"), kvp.second.name, kvp.second.value)); changed = false; } -- 2.45.2