Skip to content

dd: keep numeric-looking values verbatim in errors - #16182

Merged
sylvestre merged 1 commit into
uutils:mainfrom
eylulseyit:dd-numeric-operand-verbatim
Nov 5, 2026
Merged

sylvestre merged 1 commit into
uutils:mainfrom
eylulseyit:dd-numeric-operand-verbatim

Conversation

@eylulseyit

Copy link
Copy Markdown
Contributor

The argument errors passed the user's value to translate!, which hands anything that parses as a number to Fluent as a number

$ dd 007
before: dd: unrecognized operand '7'
GNU:    dd: unrecognized operand '007'

$ dd bs=1e3
before: dd: invalid number: '1000'
GNU:    dd: invalid number: '1e3'

Switch the 10 ParseError messages in src/uu/dd/src/parseargs.rs that show the user’s value (operand, flag, conv, status, number) from translate! to translate_text!, which always passes the value as a string so Fluent leaves it untouched, the same change already made in tac and tail.

Part of #15533

The argument errors passed the user's value to translate!, which hands
anything that parses as a number to Fluent as a number, so `dd 007`
printed "unrecognized operand '7'" and `bs=1e3` "invalid number: '1000'".
Use translate_text! for these messages so the value is printed as
given, like GNU dd.
@eylulseyit
eylulseyit force-pushed the dd-numeric-operand-verbatim branch from 98ced64 to 4c8fc80 Compare November 4, 2026 22:00
@sylvestre
sylvestre merged commit 008d7b5 into uutils:main Nov 5, 2026
101 of 102 checks passed
@sylvestre

Copy link
Copy Markdown
Contributor

Thanks for your PR

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