Skip to content

Fix dd audit test failures#14

Open
kelp wants to merge 1 commit intomainfrom
fix-dd-audit-tests
Open

Fix dd audit test failures#14
kelp wants to merge 1 commit intomainfrom
fix-dd-audit-tests

Conversation

@kelp
Copy link
Copy Markdown
Owner

@kelp kelp commented Mar 30, 2026

Summary

  • Fix conv=swab to preserve the last byte on odd-length input instead of zeroing it (GNU dd behavior)
  • Fix conv=sync to pad with spaces instead of NUL when conv=block or conv=unblock is active
  • Replace both ascii_to_ebcdic and ascii_to_ibm tables with correct GNU coreutils values (the entire high half 0x80-0xFF was wrong, causing incorrect EBCDIC conversions for extended characters and wrong mappings for '^' and '~')
  • Update existing swab odd-length test to match corrected GNU behavior

Test plan

  • All 4 previously failing dd audit tests now pass
  • All existing dd tests continue to pass (40/40)
  • No new test failures introduced

Generated with Claude Code

Four bugs fixed:
- conv=swab: preserve last byte on odd-length input (was zeroing it)
- conv=sync+block: pad with spaces not NUL when block/unblock active
- EBCDIC tables: replace with correct GNU coreutils tables (high half
  0x80-0xFF was completely wrong, '^' and '~' mappings were swapped)
- Update existing swab odd-length test to match GNU behavior
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.

1 participant