Silence warnings about unitialized values.
sub show_lines {
state $nr =
sub show_lines {
state $nr =
- $opt{hidemin} < 0 ? @lines + $opt{hidemin} + 1 :
+ $opt{hidemin} < 0 ? max(0, @lines + $opt{hidemin} + 1) :
$opt{hidemin};
@lines > $nr or return;
$opt{hidemin};
@lines > $nr or return;
if ($opt{hidemin} and $opt{hidemin} < 0) {
$limit -= $opt{hidemax} - 1;
}
if ($opt{hidemin} and $opt{hidemin} < 0) {
$limit -= $opt{hidemax} - 1;
}
+ elsif ($opt{hidemax} <= $limit) {
$limit = $opt{hidemax} - 1;
}
}
$limit = $opt{hidemax} - 1;
}
}
--- /dev/null
+t1700-empty_input.in
\ No newline at end of file