mirror of
https://github.com/sharkdp/bat
synced 2024-11-27 14:20:45 +00:00
Line range minus overflow prevention
This commit is contained in:
parent
0eb4aaac1e
commit
715b0d8bf5
1 changed files with 1 additions and 1 deletions
|
@ -63,7 +63,7 @@ impl LineRange {
|
|||
.parse()
|
||||
.map_err(|_| "Invalid character after -")?;
|
||||
let prev_lower = new_range.lower;
|
||||
new_range.lower -= prior_lines;
|
||||
new_range.lower = new_range.lower.saturating_sub(*prior_lines);
|
||||
prev_lower
|
||||
} else {
|
||||
line_numbers[1].parse()?
|
||||
|
|
Loading…
Reference in a new issue