From 44b821003783c14372fb3e52e6463130d03dc63b Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Fri, 12 Apr 2024 13:01:16 +0100 Subject: [PATCH] Codechange: settingsgen's CopyFile actually appends. (#12485) --- src/settingsgen/settingsgen.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/settingsgen/settingsgen.cpp b/src/settingsgen/settingsgen.cpp index 9a55d0d17076e..4b265276bb084 100644 --- a/src/settingsgen/settingsgen.cpp +++ b/src/settingsgen/settingsgen.cpp @@ -322,11 +322,11 @@ static void DumpSections(const IniLoadFile &ifile) } /** - * Copy a file to the output. - * @param fname Filename of file to copy. + * Append a file to the output stream. + * @param fname Filename of file to append. * @param out_fp Output stream to write to. */ -static void CopyFile(const char *fname, FILE *out_fp) +static void AppendFile(const char *fname, FILE *out_fp) { if (fname == nullptr) return; @@ -476,10 +476,10 @@ int CDECL main(int argc, char *argv[]) /* Write output. */ if (output_file == nullptr) { - CopyFile(before_file, stdout); + AppendFile(before_file, stdout); _stored_output.Write(stdout); _post_amble_output.Write(stdout); - CopyFile(after_file, stdout); + AppendFile(after_file, stdout); } else { static const char * const tmp_output = "tmp2.xxx"; @@ -487,10 +487,10 @@ int CDECL main(int argc, char *argv[]) if (fp == nullptr) { FatalError("Cannot open file {}", tmp_output); } - CopyFile(before_file, fp); + AppendFile(before_file, fp); _stored_output.Write(fp); _post_amble_output.Write(fp); - CopyFile(after_file, fp); + AppendFile(after_file, fp); fclose(fp); if (CompareFiles(tmp_output, output_file)) {