1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 03:57:44 +00:00

Merge pull request #6764 from cakebaker/cat_remove_duplicate_code

cat: use `write_end_of_line()`  to avoid duplicate code
This commit is contained in:
Sylvestre Ledru 2024-10-03 08:50:19 +02:00 committed by GitHub
commit 5ae8316ace
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -557,10 +557,7 @@ fn write_new_line<W: Write>(
write!(writer, "{0:6}\t", state.line_number)?;
state.line_number += 1;
}
writer.write_all(options.end_of_line().as_bytes())?;
if is_interactive {
writer.flush()?;
}
write_end_of_line(writer, options.end_of_line().as_bytes(), is_interactive)?;
}
Ok(())
}