Skip to content

Commit

Permalink
Fix missing newline
Browse files Browse the repository at this point in the history
  • Loading branch information
delehef committed Nov 13, 2022
1 parent 67673e3 commit d25667e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit d25667e

Please sign in to comment.