Repository navigation
xargs: only blanks and newlines separate arguments - #920
Conversation
CR, VT and FF were treated like spaces inside the input, so 'a\rb' became two arguments. GNU xargs (and POSIX in the C locale) skips them before an argument but keeps them inside one.
There was a problem hiding this comment.
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.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #920 +/- ##
=======================================
Coverage 92.62% 92.63%
=======================================
Files 37 37
Lines 7808 7818 +10
Branches 392 392
=======================================
+ Hits 7232 7242 +10
Misses 435 435
Partials 141 141 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merging this PR will not alter performance1 warning
Comparing |
|
Commit c7483f4 has test result changes: GNU findutils testsuite: bfs testsuite: |
|
Thanks for your PR |
The input reader splits on
is_ascii_whitespace(), so CR and FF inside a word end the argument (VT does not). GNU xargs, and POSIX in the C locale, separate arguments only at blanks (space, tab) and newlines; CR, VT and FF are skipped before an argument but kept inside one:A file with CRLF line endings is the common case:
a b\r\ngavebinstead ofb\r.New test
test_whitespace_delimited_reader_only_blanks_separate; it fails on main.cargo testgreen, clippy clean. Same output as GNU for the input above, for CRLF input with-L1, and for lines of only\r\f\vand blanks.