X-Git-Url: http://git.shiar.nl/barcat.git/blobdiff_plain/90dc00d53cc4cb03416e6a85bd3dd889196ac6aa..843b8a4b9817d4d7d59f279ca2e74d2ae374fc78:/barcat diff --git a/barcat b/barcat index b65271e..35ef3b3 100755 --- a/barcat +++ b/barcat @@ -194,7 +194,7 @@ sub color { 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; @@ -203,7 +203,7 @@ if (defined $opt{hidemax}) { if ($opt{hidemin} and $opt{hidemin} < 0) { $limit -= $opt{hidemax} - 1; } - else { + elsif ($opt{hidemax} <= $limit) { $limit = $opt{hidemax} - 1; } }