Skip to content

Commit e886f0f

Browse files
committed
fixes newline bug
1 parent 1a1a002 commit e886f0f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/sed/processor.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,10 @@ fn process_file(
567567
'p' => {
568568
// Write the pattern space to standard output.
569569
write_chunk(output, context, &pattern)?;
570+
if !pattern.is_newline_terminated() {
571+
// !chomped equivalent
572+
output.write_str("\n")?; // explicit \n
573+
}
570574
}
571575
'P' => {
572576
// Output pattern space, up to the first \n.

0 commit comments

Comments
 (0)