Uh oh!
There was an error while loading. Please reload this page.
Fix/printf help plain headings 13988 - #14073
Closed
nagendramohan wants to merge 2 commits into
Closed
Conversation
nl accepted an arbitrarily large line-number field width, so a large '-w N' made 'number_width + 1' exceed isize::MAX and abort with a capacity overflow when the blank prefix was built: $ printf '\n' | nl -w 9223372036854775807 thread 'main' panicked ... capacity overflow (exit 134) Bound '-w' to [1, INT_MAX] as GNU does, rejecting out-of-range values up front with the existing 'invalid line number field width' error. Also display the exact offending value (via quote()) rather than a rounded one, and drop the now-redundant quotes from the message. Adds a regression test (verified failing before the fix). Closesuutils#13347. Signed-off-by: Nagendra Mohan <nagendramohan1990@gmail.com>
`printf --help` printed raw Markdown headings (`### ESCAPE SEQUENCES`, `#### SUBSTITUTION QUICK REFERENCE`, ...) leaked from the after-help text, which the terminal shows verbatim. Convert the Markdown headings to plain-text headings ending in a colon, matching the fix already applied to cut and dd in uutils#13982. Updates both the en-US and fr-FR locale strings. Fixesuutils#13988
nagendramohan
commented
Aug 22, 2026
ContributorAuthor
Closing in favor of # — this branch accidentally included an unrelated nl commit. The clean PR has only the printf help-text change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
printf --helpprinted raw Markdown headings (### ESCAPE SEQUENCES,#### SUBSTITUTION QUICK REFERENCE, etc.) from the after-help text, which theterminal shows verbatim.
This converts those Markdown headings to plain-text headings ending in a colon,
matching the fix already applied to
cutandddin #13982. Both theen-USand
fr-FRlocale strings are updated (French uses theTitre :spacing).Before:
ESCAPE SEQUENCES
After:
ESCAPE SEQUENCES:
No logic change; text only.
printf --helpno longer shows any raw###/####,and the printf test suite passes (138 passed).
Fixes#13988