diff --git a/src/controller.rs b/src/controller.rs index 6f38a908..f91c0554 100644 --- a/src/controller.rs +++ b/src/controller.rs @@ -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(())