Skip to content

od: print final offset when an input fails - #16035

Open
Logic769 wants to merge 4 commits into
uutils:mainfrom
Logic769:od-final-offset-on-error
Open

Logic769 wants to merge 4 commits into
uutils:mainfrom
Logic769:od-final-offset-on-error

Conversation

@Logic769

Copy link
Copy Markdown
Contributor

Problem

When one of the od inputs could not be read, the final offset line was omitted. GNU still prints it after the error.

Change

Always write the final offset when the input ends or fails, and add a regression test using a directory as an input.

Closes #15990

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/od/od-N. tests/od/od-N is passing on 'main'. Maybe you have to rebase?

@Logic769
Logic769 force-pushed the od-final-offset-on-error branch 2 times, most recently from 288df47 to 6bd068f Compare October 30, 2026 13:02
@Logic769
Logic769 force-pushed the od-final-offset-on-error branch 2 times, most recently from 5f25921 to ccb9d66 Compare November 1, 2026 14:41
Comment thread tests/by-util/test_od.rs Resolved
Comment thread tests/by-util/test_od.rs Resolved
Track whether any input was opened so that a directory, which can be opened but not read, still gets its final offset printed like GNU. Tighten the failing-input test to the exact output and cover od d alone and od missing.

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.

od: final offset line missing when an input file fails

2 participants