Skip to content

pr: fill the rest of a merged page with empty lines - #16717

Open
ihsandeniz wants to merge 1 commit into
uutils:mainfrom
ihsandeniz:fix/pr-merge-empty-lines
Open

ihsandeniz wants to merge 1 commit into
uutils:mainfrom
ihsandeniz:fix/pr-merge-empty-lines

Conversation

@ihsandeniz

Copy link
Copy Markdown
Contributor

Split out of #16555, as asked there.

With -m and a page trailer, once every file has run out the rest of the page was printed as padded empty columns: each line got the column width in spaces and a TAB. GNU writes plain empty lines there.

$ printf 'x\ny\n' > a; printf 'z\n' > b
$ pr -m -l 15 a b | sed -n 8,10p | cat -A
GNU 9.12 / this PR:   $
before:               <35 spaces>^I$

The blank lines in test_merge are updated to match.

I wrote this with the help of an AI assistant; the expected output comes from running GNU's pr binary.

Like GNU pr, once every file has run out, the rest of the page is empty
lines rather than padded empty columns.
Comment thread src/uu/pr/src/pr.rs
@@ -1599,8 +1599,13 @@ fn write_columns(
for row in table {
// Merged files are padded with empty cells to fill the page; once
// every file has run out there is nothing left to print.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this comment is now half wrong, "nothing left to print" is only true without a trailer. could you merge it with the one below?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants