GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — cmp: size the -l offset column from the bytes left after the skips by jayhemnani9910 · Pull Request #330 · uutils/diffutils

Conversation

@jayhemnani9910

@jayhemnani9910 jayhemnani9910 commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

cmp -l pads the byte offsets to the width of the largest offset it can print. That is the smaller file size, but the offsets count from the end of the skipped bytes, and the skips were not subtracted. GNU cmp subtracts them:

$ printf '0123456789abcdefghijklmnopqrstuvwxyz' > a; cp a b
$ LC_ALL=C cmp -l --ignore-initial=27:26 a b
cmp: EOF on 'a' after byte 9
 1 162 161        # GNU cmp 3.12: "1 162 161"
 2 163 162

cmp now subtracts each file's skip from its size (stopping at 0) before taking the smaller one. Without skips nothing changes.

Test cmp_verbose_offset_width_after_skip (fails on main). cargo test: 132 + 132 + 2 + 24 pass (23 cmp tests on main), cargo clippy -- -D warnings clean. Compared with GNU cmp 3.12 under LC_ALL=C for skips on one or both files, -i A:B, a skip past the end and no skip: same output.

#296 changes the quiet size check a few lines above; the two touch different lines.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jayhemnani9910
cmp: size the -l offset column from the bytes left after the skips
df50f26
The offsets count from the end of the skipped bytes, so the widest one
is the smaller file size minus its skip, as GNU cmp computes it.
Copilot AI balanced review requested due to automatic review settings October 26, 2026 03:03
Copilot AI reviewed Oct 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sylvestre
sylvestre merged commit 9191942 into uutils:main Nov 8, 2026
31 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@sylvestre

sylvestre commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

Thanks for your PR

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sylvestre sylvestre mentioned this pull request Nov 9, 2026
cmp - -l offset column is 19 characters wide when one operand is stdin #348
Open
@sarankumar1325 sarankumar1325 mentioned this pull request Nov 10, 2026
cmp: size the -l offset column from the regular-file operand when the other is stdin #373
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@jayhemnani9910 @sylvestre
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.