Skip to content

Commit

Permalink
Solving extra blank line error BurntSushi#441
Browse files Browse the repository at this point in the history
  • Loading branch information
deg4uss3r committed Oct 23, 2017
1 parent 1aec4b1 commit 78b1d3f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/printer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::error;
use std::fmt;
use std::path::Path;
use std::str::FromStr;
use std::io::BufRead;

use regex::bytes::{Captures, Match, Regex, Replacer};
use termcolor::{Color, ColorSpec, ParseColorError, WriteColor};
Expand Down Expand Up @@ -305,6 +306,9 @@ impl<W: WriteColor> Printer<W> {
self.write_path_sep(b':');
}
if let Some(line_number) = line_number {
if line_number > buf.lines().count() as u64 {
return;
}
self.line_number(line_number, b':');
}
if self.column {
Expand Down

0 comments on commit 78b1d3f

Please sign in to comment.