Skip to content

pr: drop a tab that is wider than the page width - #16815

Open
seragAhmed wants to merge 1 commit into
uutils:mainfrom
seragAhmed:fix/16499-pr-drop-wide-char
Open

seragAhmed wants to merge 1 commit into
uutils:mainfrom
seragAhmed:fix/16499-pr-drop-wide-char

Conversation

@seragAhmed

Copy link
Copy Markdown

Fixes #16499

With -W narrower than a tab, pr kept the tab and cut the line by character count, so printf '\tone\n' | pr -t -W 5 printed \tone instead of an empty line.

char_prefix_len now stops at a tab that is wider than the column by itself, which drops it together with the rest of the line. The line number and its separator are always kept, so -n -W 5 prints 1\t. Other tabs still count as one character, so the merged-column output in test_with_mpr is unchanged.

This enables test_pr::test_page_width_narrower_than_leading_tab (added in #16493). All 114 test_pr tests pass, and cargo fmt and clippy -D warnings are clean for uu_pr.

@seragAhmed

Copy link
Copy Markdown
Author

The failing jobs all stop at the same step, before any test runs: sccache: error: Timed out waiting for server startup. Could someone re-run the failed jobs?

Like GNU pr, a tab wider than the column is dropped together with the
rest of the line, and the line number is never cut. Enables
test_page_width_narrower_than_leading_tab.

Fixes uutils#16499
@sylvestre
sylvestre force-pushed the fix/16499-pr-drop-wide-char branch from bc8b4c0 to 902a904 Compare November 26, 2026 06:37

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.

pr: char wider than the page width is not dropped

1 participant