Skip to content

sed: reject unknown POSIX class names in bracket expressions - #713

Open
draarivpatel-ui wants to merge 1 commit into
uutils:mainfrom
draarivpatel-ui:reject-unknown-posix-class
Open

draarivpatel-ui wants to merge 1 commit into
uutils:mainfrom
draarivpatel-ui:reject-unknown-posix-class

Conversation

@draarivpatel-ui

Copy link
Copy Markdown

GNU sed accepts only the twelve POSIX class names inside [: :] and stops with Invalid character class name for anything else. uutils copied the name to the regex engine, which silently accepts its own extras ([[:word:]], [[:ascii:]]) and misreads misspelt names such as [[:foo:]].

The name is now checked against the POSIX list when a [: :] construct terminates in parse_character_class. Collating symbols ([. .]) and equivalence classes ([= =]) are untouched.

Closes #646

Copilot AI balanced review requested due to automatic review settings November 24, 2026 19:52

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 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

codecov Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.46%. Comparing base (ead76c2) to head (0bb39df).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #713   +/-   ##
=======================================
  Coverage   95.46%   95.46%           
=======================================
  Files          14       14           
  Lines        7789     7792    +3     
  Branches      473      474    +1     
=======================================
+ Hits         7436     7439    +3     
  Misses        352      352           
  Partials        1        1           
Flag Coverage Δ
macos_latest 96.91% <100.00%> (+<0.01%) ⬆️
ubuntu_latest 96.84% <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.

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.

sed - unknown POSIX class names like [[:foo:]] or [[:word:]] are accepted instead of rejected

2 participants