Skip to content

sed: keep script position for errors at end of script - #579

Merged
sylvestre merged 1 commit into
uutils:mainfrom
sylvestre:script-end-position
Sep 27, 2026
Merged

sylvestre merged 1 commit into
uutils:mainfrom
sylvestre:script-end-position

Conversation

@sylvestre

Copy link
Copy Markdown
Contributor

An error found once the script is exhausted, like an unterminated command, lost its location and was reported as :0:N. Keep the last input name and line number, so it points at the script argument or file line, as GNU sed does.

$ sed --posix 'i\'
before: sed: :0:3: error: incomplete command
after:  sed: <script argument 1>:1:3: error: incomplete command
GNU:    sed: -e expression #1, char 2: incomplete command

$ sed 's/a/b\'
before: sed: :0:7: error: unterminated substitute replacement (unexpected EOF)
after:  sed: <script argument 1>:1:7: error: unterminated substitute replacement (unexpected EOF)
GNU:    sed: -e expression #1, char 6: unterminated `s' command

Split out of #576.

Copilot AI lite review requested due to automatic review settings September 27, 2026 17:03

Copilot AI left a comment

Copy link
Copy Markdown

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 reached their quota limit.

@codecov

codecov Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 61.53846% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.83%. Comparing base (72ed709) to head (43681a9).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/sed/script_line_provider.rs 61.53% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #579      +/-   ##
==========================================
- Coverage   83.87%   83.83%   -0.05%     
==========================================
  Files          14       14              
  Lines        6977     6984       +7     
  Branches      407      407              
==========================================
+ Hits         5852     5855       +3     
- Misses       1121     1125       +4     
  Partials        4        4              
Flag Coverage Δ
macos_latest 84.98% <61.53%> (-0.05%) ⬇️
ubuntu_latest 85.18% <61.53%> (-0.05%) ⬇️
windows_latest 0.00% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

Copy link
Copy Markdown

GNU sed testsuite comparison:

Test results comparison:
  Current:   TOTAL: 65 / PASSED: 15 / FAILED: 42 / SKIPPED: 8
  Reference: TOTAL: 65 / PASSED: 14 / FAILED: 43 / SKIPPED: 8

Changes from main branch:
  TOTAL: +0
  PASSED: +1
  FAILED: -1

Test improvements (1):
  + cmd-R

Copilot AI review requested due to automatic review settings September 27, 2026 18:17

Copilot AI left a comment

Copy link
Copy Markdown

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 reached their quota limit.

@codspeed

codspeed Bot commented Sep 27, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 5.26%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
❌ 1 regressed benchmark
✅ 9 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ number_fix 1.1 s 1.3 s -13.81%
⚡ access_log_subst 2.4 s 2.3 s +4.13%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing sylvestre:script-end-position (43681a9) with main (72ed709)

Open in CodSpeed

@sylvestre
sylvestre merged commit b451333 into uutils:main Sep 27, 2026
28 of 31 checks passed
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.

2 participants