Skip to content

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

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

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

Conversation

@Logic769

@Logic769 Logic769 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Problem

When an od input fails, the final offset line was omitted. GNU still prints it after a read error when some input has already been consumed.

Change

Print the final offset after a read error only when the input offset has advanced, and add regression tests for a directory with and without -N1, and for an unreadable path.

Closes #15990

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

GNU testsuite comparison:

Congrats! The gnu test tests/env/env is no longer failing!
Congrats! The gnu test tests/misc/usage_vs_getopt is no longer failing!

@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
@sylvestre

Copy link
Copy Markdown
Contributor

a bunch of jobs are failing

@Logic769
Logic769 force-pushed the od-final-offset-on-error branch from 0291e3d to 9ca56d3 Compare November 3, 2026 15:42
@Logic769
Logic769 force-pushed the od-final-offset-on-error branch from 4859389 to 5b163bf Compare November 16, 2026 04:11
@sylvestre
sylvestre force-pushed the od-final-offset-on-error branch from 5b163bf to bbe59ad Compare November 16, 2026 21:36
Logic769 and others added 5 commits November 18, 2026 12:38
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.
@Logic769
Logic769 force-pushed the od-final-offset-on-error branch from bbe59ad to d6acd81 Compare November 18, 2026 04:38
@github-actions

Copy link
Copy Markdown

Binary size comparison:

Individual binary size comparison VS main (threshold: >=5% AND >=4 KB).

Total size of compared binaries: 155.49 MB (+108 KB, +0.07%)

Significant per-binary changes:
  env     1.20 MB ->    1.28 MB  (+80 KB, +6.51%)

@Logic769

Copy link
Copy Markdown
Contributor Author

CI note: the Build MSYS (windows-latest, feat_os_windows) job failed in its packaging step, not in this PR's code:

mv target/release-small/deps/stdbuf.dll -t /tmp/c/usr/local/bin
mv: cannot stat 'target/release-small/deps/stdbuf.dll': No such file or directory

The same stdbuf.dll packaging failure is appearing on several unrelated PRs, so it looks like an MSYS/Windows packaging issue in the shared make workflow rather than a failure caused by this change.

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