From cd377b2b10d5fe289645cfe2c118f0f7398ee0a7 Mon Sep 17 00:00:00 2001 From: Kornel Date: Sun, 10 Sep 2023 22:19:36 +0100 Subject: [PATCH] Don't add newline to conffiles Fixes #110 --- src/control.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/control.rs b/src/control.rs index 4c1bd0a8..0c58bea9 100644 --- a/src/control.rs +++ b/src/control.rs @@ -31,7 +31,7 @@ impl<'l, W: Write> ControlArchiveBuilder<'l, W> { pub fn generate_archive(&mut self, options: &Config) -> CDResult<()> { self.generate_control(options)?; if let Some(ref files) = options.conf_files { - self.generate_conf_files(files)?; + self.add_conf_files(files)?; } self.generate_scripts(options)?; if let Some(ref file) = options.triggers_file { @@ -242,12 +242,8 @@ impl<'l, W: Write> ControlArchiveBuilder<'l, W> { } /// If configuration files are required, the conffiles file will be created. - fn generate_conf_files(&mut self, files: &str) -> CDResult<()> { - let mut data = Vec::new(); - data.write_all(files.as_bytes())?; - data.push(b'\n'); - self.archive.file("./conffiles", &data, 0o644)?; - Ok(()) + fn add_conf_files(&mut self, files: &str) -> CDResult<()> { + self.archive.file("./conffiles", files.as_bytes(), 0o644) } fn generate_triggers_file(&mut self, path: &Path) -> CDResult<()> {