Skip to content

Commit

Permalink
Merge pull request #350 from mknos/pr-loop
Browse files Browse the repository at this point in the history
pr: incorrect looping with -l
  • Loading branch information
briandfoy authored Nov 25, 2023
2 parents 8be676c + 89965cb commit 2c87271
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bin/pr
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ sub create_col {
my($col)=@_;

my $pagelen=$length-($trailerlength*2);
if ($pagelen <= 0) {
$trailer = 0;
$pagelen = 1;
}
if($doublespace) {
$pagelen=($pagelen%2 == 0)?$pagelen/2:int($pagelen/2)+1;
}
Expand Down Expand Up @@ -337,7 +341,7 @@ sub printpage {
print $numbering;
print $numberchar if ($number);

if (!$column_sep) {
if (!$column_sep && $trailer) {
$pfmt="%-${colwidth}s";
printf("$pfmt", $$column{text}[$line-1]{text});
} else {
Expand Down

0 comments on commit 2c87271

Please sign in to comment.