Skip to content

od: say the skip ran past the end of the combined input - #14399

Open
Socialpranker wants to merge 1 commit into
uutils:mainfrom
Socialpranker:od-skip-past-end
Open

od: say the skip ran past the end of the combined input#14399
Socialpranker wants to merge 1 commit into
uutils:mainfrom
Socialpranker:od-skip-past-end

Conversation

@Socialpranker

Copy link
Copy Markdown
Contributor

-j/--skip-bytes is measured over all the inputs joined together, so the
message naming a single "input" is misleading once more than one file is
given:

$ printf abc > a; printf de > b

$ od -j6 a b          # GNU
od: cannot skip past end of combined input
$ od -j6 a b          # uutils, before
od: tried to skip past end of input

GNU prints that one wording for every shape of the failure — one file,
several files, stdin, with or without -N — so this is a straight string
change in src/uu/od/locales/en-US.ftl, with the French translation
updated to match.

How the GNU behavior was established

By running the installed GNU coreutils 9.11 binary (Homebrew, god) as a
black box: -j past the end of one file, of two files, of piped stdin,
combined with -N, and the boundary case -j5 a b that must still
succeed. Exit status and stderr diffed against uutils. I did not read GNU
coreutils source.

Testing

  • New test_skip_bytes_past_end_message in tests/by-util/test_od.rs
    pins the exact stderr and exit status 1 for the two-file case.
    Mutation-checked: reverting the .ftl line alone makes it fail.
  • cargo test --features od --test tests test_od: 78 passed, 0 failed.
  • cargo clippy -p uu_od --all-targets -- -D warnings: clean.
  • cargo fmt --check: clean.
  • Differential A/B against GNU coreutils 9.11 over the 72 od invocations
    in my harness: mismatches 2 -> 0.

Not in scope

Two neighbouring differences left alone: od -j 1x f reports
invalid -j argument '1x' where GNU reports
invalid suffix in -j argument '1x', and when a named file is missing
uutils prints this skip error after the No such file or directory line
while GNU stops at the first.

Disclosure

Prepared with AI assistance (Claude Opus 5, via Claude Code), per the AI
policy in CONTRIBUTING.md. Every GNU behavior quoted above came from
running the installed binary, not from reading GPL source. All testing was
run locally.

-j is measured over all the inputs joined together, so naming a single
'input' misleads when several files were given:

    $ od -j6 a b
    od: tried to skip past end of input               # was
    od: cannot skip past end of combined input        # GNU, and now
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/cut/bounded-memory (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/date/date-locale-hour (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/date/resolution (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/retry (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/pr/bounded-memory (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/tail-n0f (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/tail/pipe-f is now passing!

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