Repository navigation
sed: accept blanks and a missing number after + in addr1,+N - #662
Conversation
GNU sed skips blanks between the + of an addr1,+N range and its number, and reads a missing number as 0. Do the same instead of failing with "number expected". Fixes uutils#651
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. 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.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #662 +/- ##
=======================================
Coverage 95.24% 95.25%
=======================================
Files 14 14
Lines 7490 7500 +10
Branches 442 442
=======================================
+ Hits 7134 7144 +10
Misses 355 355
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Fixes #651
GNU sed skips blanks between the
+of anaddr1,+Nrange and its number, and reads a missing number as 0. uutils sed failed both withnumber expected:compile_addressnow skips blanks after+and parses the number as optional, defaulting to 0.2,+1dis unchanged.It uses the existing
eat_spaces, like the rest of the address parser, so it follows whatever #654 decides about which blanks count.Tests:
test_relative_range_blank_or_missing_number(space, tab, missing number, plain+1; fails on main)test_compile_addr_relative_line_blank_and_missing_numberincompiler.rscargo test,cargo fmt --checkandcargo clippy --all-targets -- -D warningspass locallyI used an AI assistant (Grok Bot) to help write this change. I reviewed the diff, compared the behaviour with GNU sed 4.9 on my machine and ran the tests above.