Skip to content

Commit

Permalink
Retain non carriage return instead of pop.
Browse files Browse the repository at this point in the history
  • Loading branch information
hhandika committed Sep 2, 2024
1 parent fbe147e commit fe5a512
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/parser/maf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,11 +519,13 @@ impl<R: Read> MafReader<R> {
paragraph
}

// Check cariage return for windows
// Check carriage return for windows
#[cfg(target_os = "windows")]
fn check_carriage_return(&mut self) {
if self.buf.ends_with(&[CAR_RETURN]) {
self.buf.pop();
if self.buf.contains(&CAR_RETURN) {
// Remove the carriage return
// and leave only the line feed
self.buf.retain(|&c| c != CAR_RETURN);
}
}

Expand Down

0 comments on commit fe5a512

Please sign in to comment.