Skip to content

numfmt: only take a unit from the next field when converting this one - #17009

Open
seragAhmed wants to merge 1 commit into
uutils:mainfrom
seragAhmed:fix/16999-numfmt-space-separator
Open

seragAhmed wants to merge 1 commit into
uutils:mainfrom
seragAhmed:fix/16999-numfmt-space-separator

Conversation

@seragAhmed

Copy link
Copy Markdown
Contributor

With --unit-separator=' ', the whitespace splitter merged any field with a following suffix-like word, even when that field wasn't selected. In 42 R 8192 2048 the 42 R became one field, so --field=3 converted the resident memory column instead of the virtual one.

Now a field only takes the next word as its unit when it is one of the fields being converted, so unselected fields keep their numbering. Added a test with the rows from the issue.

Fixes #16999

With a blank --unit-separator, a field followed by a word that looks like a
suffix ("42 R") was merged with it even when the field was not selected,
which shifted the numbering of every later field.

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.

numfmt: a space unit separator can make --field convert the wrong column

1 participant