Skip to content

Commit b8f25cc

Browse files
authored
pr: improve -o margin_spaces
* OpenBSD pr and GNU pr treat -o NUMBER as the number of margin spaces, but this version was printing Os * Another difference I noted was that the page header is expected to offset based on -o, but it did not * Tested with: perl pr -o 5 pr
1 parent ae511f5 commit b8f25cc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

bin/pr

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,10 @@ sub print_header {
287287
my($col)=@_; # the current column.
288288
return if (!$trailer);
289289

290-
print "\n\n", scalar(localtime), " ";
290+
print "\n\n";
291+
print ' ' x $offsetspaces if $offsetspaces;
292+
print scalar(localtime), " ";
293+
291294
if ($header) {
292295
print "$header ";
293296
} else {
@@ -320,7 +323,7 @@ sub printpage {
320323

321324
print_header($COLINFO[0]);
322325
foreach my $line (1..$COLINFO[0]{oheight}) {
323-
print "O"x${offsetspaces} if ($offsetspaces);
326+
print ' ' x $offsetspaces if $offsetspaces;
324327
foreach my $column (@COLINFO) {
325328
my $pfmt;
326329
my $numbering="";

0 commit comments

Comments
 (0)