Skip to content

expand: accept a zero +N or /N after a tab list - #16637

Merged
cakebaker merged 1 commit into
uutils:mainfrom
Xnadir:expand-zero-increment
Nov 18, 2026
Merged

cakebaker merged 1 commit into
uutils:mainfrom
Xnadir:expand-zero-increment

Conversation

@Xnadir

@Xnadir Xnadir commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

expand -t 4,+0 failed with tab size cannot be 0. GNU accepts it, and so does our unexpand. After a tab list, +0 or /0 sets no tab size: a later number still gives one (4,+0,8 acts like 4,+8), and if none does, the list is used as given (4,+0 acts like 4).

tabstops_parse now skips such a zero instead of failing. After the loop, a +// that never got a number no longer turns the last tab stop into a tab size. That also fixes 2,6,+, which spaced every column after 6 by 6 instead of using single spaces as GNU does. A standalone +0 or /0 still fails as before.

The test covers 4,+0, 4,/0, 2,6,+0, 2,6,/0, 4,+0,8, 4,+0,+2, 4,/0,10 and 2,6,+, with the outputs of GNU expand (coreutils 8.32, the version I have locally). It fails on main.

AI disclosure: written with help from Claude Code. Nothing was derived from GNU source.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 17, 2026 16:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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. Try requesting a review at a lower effort level.

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.

@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%)

@cakebaker
cakebaker merged commit 293a724 into uutils:main Nov 18, 2026
106 of 108 checks passed
@cakebaker

Copy link
Copy Markdown
Contributor

Thanks!

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.

3 participants