Skip to content

pr: continue line numbers after a form feed - #16170

Merged
RenjiSann merged 4 commits into
uutils:mainfrom
1kailas:pr-form-feed-line-numbers
Nov 4, 2026
Merged

RenjiSann merged 4 commits into
uutils:mainfrom
1kailas:pr-form-feed-line-numbers

Conversation

@1kailas

@1kailas 1kailas commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

With -n, a form feed ends a line but did not advance the line counter, so the next line got the same number and all later numbers were one too small:

$ printf 'a\fb\nc\n' | pr -T -n:1
1:a
1:b
2:c

The form feed branch of get_pages now increments the counter like the newline branch does. The \n\f case, where no line is emitted for the form feed, is unchanged. The output now matches GNU pr for these inputs.

Added test_line_numbers_continue_after_form_feed.

Closes #16131

A form feed ends a line, but the form feed branch of get_pages did not
advance the line counter, so with -n the next line was given the same
number and every later number was one too small.
Copilot AI balanced review requested due to automatic review settings November 3, 2026 19:13

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

Copilot AI balanced review requested due to automatic review settings November 4, 2026 06:54

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

Copilot AI balanced review requested due to automatic review settings November 4, 2026 07:52

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

Copilot AI balanced review requested due to automatic review settings November 4, 2026 10:35

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@RenjiSann
RenjiSann enabled auto-merge (rebase) November 4, 2026 10:49
@RenjiSann
RenjiSann merged commit 4b09a97 into uutils:main Nov 4, 2026
97 checks passed
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.

pr: -n repeats line numbers after a form feed

3 participants