Skip to content

sed: show an empty pattern space as $ in l, even without a newline - #595

Merged
sylvestre merged 1 commit into
uutils:mainfrom
DePasqualeOrg:fix-l-empty-line
Oct 4, 2026
Merged

sylvestre merged 1 commit into
uutils:mainfrom
DePasqualeOrg:fix-l-empty-line

Conversation

@DePasqualeOrg

@DePasqualeOrg DePasqualeOrg commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

When the pattern space is empty and its input line had no final newline, l prints nothing, while GNU sed prints $. For example, printf a | sed -n 's/a//;l' prints nothing instead of $. This PR prints $ and a newline for an empty pattern space in every case.

@codecov

codecov Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.84%. Comparing base (3676eac) to head (5757f78).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #595      +/-   ##
==========================================
+ Coverage   94.82%   94.84%   +0.01%     
==========================================
  Files          14       14              
  Lines        7212     7210       -2     
  Branches      428      427       -1     
==========================================
- Hits         6839     6838       -1     
+ Misses        372      371       -1     
  Partials        1        1              
Flag Coverage Δ
macos_latest 96.38% <100.00%> (+0.01%) ⬆️
ubuntu_latest 96.32% <100.00%> (+0.01%) ⬆️
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.

@DePasqualeOrg
DePasqualeOrg marked this pull request as ready for review October 4, 2026 10:30
@sylvestre
sylvestre merged commit 479c4be into uutils:main Oct 4, 2026
31 checks passed
@sylvestre

Copy link
Copy Markdown
Contributor

Thanks for your PR

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