From 1225e65299ceee6f6eda0d144f38c309cab59be3 Mon Sep 17 00:00:00 2001 From: Ethan P Date: Wed, 26 Feb 2020 11:53:58 -0800 Subject: [PATCH] Fix #798 --- src/controller.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/controller.rs b/src/controller.rs index eb45edc7..ca2b9cfb 100644 --- a/src/controller.rs +++ b/src/controller.rs @@ -79,7 +79,10 @@ impl<'b> Controller<'b> { writer: &mut dyn Write, input_file: InputFile<'a>, ) -> Result<()> { - printer.print_header(writer, input_file)?; + if !reader.first_line.is_empty() || self.config.output_components.header() { + printer.print_header(writer, input_file)?; + } + if !reader.first_line.is_empty() { self.print_file_ranges(printer, writer, reader, &self.config.line_ranges)?; }