Repository navigation
dd: fix conv=block/unblock conflict handling - #14773
Merged
sylvestre merged 1 commit intoOct 13, 2026
Merged
Conversation
ChihweiLHBird
force-pushed
the
zhiwei/fix-dd-conv-conflicts
branch
from
September 21, 2026 08:18
8062aff to
8fbfb8b
Compare
ChihweiLHBird
marked this pull request as ready for review
September 21, 2026 08:19
ChihweiLHBird
force-pushed
the
zhiwei/fix-dd-conv-conflicts
branch
from
September 21, 2026 08:30
8fbfb8b to
6def12c
Compare
|
GNU testsuite comparison: |
ChihweiLHBird
force-pushed
the
zhiwei/fix-dd-conv-conflicts
branch
4 times, most recently
from
September 27, 2026 19:31
272fc15 to
d794ae3
Compare
ChihweiLHBird
force-pushed
the
zhiwei/fix-dd-conv-conflicts
branch
from
September 28, 2026 19:28
d794ae3 to
92bedb3
Compare
ChihweiLHBird
force-pushed
the
zhiwei/fix-dd-conv-conflicts
branch
from
October 9, 2026 00:19
92bedb3 to
dbfc768
Compare
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The parser changes are coherent, correctly ordered, and covered by targeted tests.
0 open findings
What changed in this PR
Updates dd argument validation to match GNU-compatible block/unblock behavior.
Changes:
- Detects implied and explicit conversion conflicts in the correct order.
- Ignores
block/unblockwhencbsis absent. - Adds regression coverage and removes the obsolete error translation.
| File | Description |
|---|---|
src/uu/dd/src/parseargs.rs |
Revises conversion validation and mode selection. |
src/uu/dd/src/parseargs/unit_tests.rs |
Updates the conflict unit test. |
tests/by-util/test_dd.rs |
Adds compatibility regression tests. |
src/uu/dd/locales/en-US.ftl |
Removes the obsolete English error. |
src/uu/dd/locales/fr-FR.ftl |
Removes the obsolete French error. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
sylvestre
reviewed
Oct 12, 2026
sylvestre
reviewed
Oct 12, 2026
ChihweiLHBird
force-pushed
the
zhiwei/fix-dd-conv-conflicts
branch
from
October 13, 2026 00:20
dbfc768 to
a8f9cf0
Compare
Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
ChihweiLHBird
force-pushed
the
zhiwei/fix-dd-conv-conflicts
branch
from
October 13, 2026 04:52
a8f9cf0 to
85e6280
Compare
Contributor
|
Thanks for your PR |
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 free
to 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.
Summary
conv=blockandconv=unblockconvert between newline-terminated lines and fixed-size records;cbs=Nsets the record size. Theasciiconversion impliesunblock, andebcdicandibmimplyblock.Three things were off in how uutils handled the block/unblock pair:
conv=ascii,block cbs=1asks for bothunblock(viaascii) andblock, but uutils accepted it silently. GNU rejects it as a block/unblock conflict.conv=block,unblock,lcase,ucase cbs=1reported the lcase/ucase conflict instead of the block/unblock one.cbswas an error. GNU ignoresblockandunblockwhencbsis not given; uutils refused with its own "specified without cbs=N" message. POSIX leaves this case unspecified, so this part is a compatibility choice rather than a bug fix.This PR moves the block/unblock check to its place in that order, includes the implied directions, and only performs it when
cbsis given.Example
Before: silent, exit 0. After, same as GNU:
dd: cannot combine block and unblock, exit 1.Before:
dd: cannot combine lcase and ucase. After, same as GNU:dd: cannot combine block and unblock.Before:
dd: conv=block or conv=unblock specified without cbs=N, exit 1. After, same as GNU: printsab, exit 0.