diff --git a/README.org b/README.org index c7bfd55..d5a31f2 100644 --- a/README.org +++ b/README.org @@ -224,6 +224,8 @@ If you have any question or if you encounter a problem, do not hesitate to [[htt * Acknowledgments FUSTA is standing on the shoulders of, among others, [[https://github.com/cberner/fuser][fuser]], [[https://github.com/clap-rs/clap][clap]], [[https://github.com/RazrFalcon/memmap2-rs][memmap2]] and [[https://github.com/knsd/daemonize][daemonize]]. * Changelog +** v1.7.1 +- Fix missing newline in some cases ** v1.7 - Use 1-based, fully-closed genomic coordinates ** v1.6.1 diff --git a/src/fs.rs b/src/fs.rs index 3afcb74..67ab8e4 100755 --- a/src/fs.rs +++ b/src/fs.rs @@ -660,6 +660,14 @@ impl FustaFS { .write_all(&fragment.data()) .unwrap_or_else(|_| panic!("Unable to write to `{}`", tmp_filename)); index += fragment.data().len(); + if let Some(c) = fragment.data().last() { + if *c != b'\n' { + tmp_file + .write_all(&[b'\n']) + .unwrap_or_else(|_| panic!("Unable to write to `{}`", tmp_filename)); + index += 1; + } + } fragment.data = Backing::File(self.filename.clone().into(), last_start, index); fragment.refresh_virtual_files();