Skip to content

fold: skip leading blanks in the width - #16455

Merged
cakebaker merged 2 commits into
uutils:mainfrom
binhvq:fold-width-leading-blanks
Nov 17, 2026
Merged

cakebaker merged 2 commits into
uutils:mainfrom
binhvq:fold-width-leading-blanks

Conversation

@binhvq

@binhvq binhvq commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

fold -w ' 3' was rejected. Like GNU, leading blanks in the width are now skipped before parsing, while trailing ones are still an error, and the error message still quotes the width as given.

Closes #16454

Comment thread src/uu/fold/src/fold.rs Outdated
let spaces = matches.get_flag(options::SPACES);
let poss_width = matches.get_one::<String>(options::WIDTH).cloned();

// Like GNU, leading blanks are skipped, trailing ones are not.

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.

Suggested change
// Like GNU, leading blanks are skipped, trailing ones are not.
// leading blanks are skipped, trailing ones are not.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done, thanks.

@cakebaker
cakebaker merged commit dc2e60c into uutils:main Nov 17, 2026
103 of 105 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.

fold: a width with leading blanks is rejected

3 participants