mirror of
https://github.com/sharkdp/bat.git
synced 2025-01-31 02:01:05 +00:00
Line range minus overflow prevention
This commit is contained in:
parent
0eb4aaac1e
commit
715b0d8bf5
@ -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…
x
Reference in New Issue
Block a user