mirror of
https://github.com/sharkdp/bat
synced 2024-11-04 18:00:24 +00:00
Only print contents if file wasn't empty, or EOF wasn't first thing received from stdin.
This commit is contained in:
parent
10c5f79640
commit
76b7418e35
@ -80,7 +80,9 @@ impl<'b> Controller<'b> {
|
||||
input_file: InputFile<'a>,
|
||||
) -> Result<()> {
|
||||
printer.print_header(writer, input_file)?;
|
||||
self.print_file_ranges(printer, writer, reader, &self.config.line_ranges)?;
|
||||
if !reader.first_line.is_empty() {
|
||||
self.print_file_ranges(printer, writer, reader, &self.config.line_ranges)?;
|
||||
}
|
||||
printer.print_footer(writer)?;
|
||||
|
||||
Ok(())
|
||||
|
Loading…
Reference in New Issue
Block a user