Skip to content

find: preserve -regextype across parentheses - #934

Merged
sylvestre merged 1 commit into
uutils:mainfrom
zhangpan2001:fix/933-regextype-parentheses
Nov 2, 2026
Merged

sylvestre merged 1 commit into
uutils:mainfrom
zhangpan2001:fix/933-regextype-parentheses

Conversation

@zhangpan2001

Copy link
Copy Markdown
Contributor

The parser reset the regex syntax on each recursive call, so a setting outside parentheses was ignored inside them and a setting inside was lost after the closing parenthesis.

Share the syntax state across recursive calls. Each -regex or -iregex still uses the setting in effect at its position on the command line.

Add regression tests for both predicates, including nested groups and settings in short-circuited branches. All 14 cases fail before the fix and pass after it.

Fixes #933

@codecov

codecov Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.87%. Comparing base (3b14698) to head (f61690d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #934      +/-   ##
==========================================
+ Coverage   92.79%   92.87%   +0.07%     
==========================================
  Files          37       37              
  Lines        8038     8039       +1     
  Branches      403      403              
==========================================
+ Hits         7459     7466       +7     
+ Misses        437      431       -6     
  Partials      142      142              

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

@codspeed

codspeed Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

1 warning

⚠️ 15 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 20 untouched benchmarks


Comparing zhangpan2001:fix/933-regextype-parentheses (f61690d) with main (3b14698)

Open in CodSpeed

@github-actions

Copy link
Copy Markdown

Commit 95c7980 has test result changes:

bfs testsuite:

Test results comparison:
  Current:   TOTAL: 317 / PASSED: 278 / FAILED: 33 / SKIPPED: 6
  Reference: TOTAL: 317 / PASSED: 277 / FAILED: 34 / SKIPPED: 6

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

Test improvements (1):
  + gnu/inum_automount

1 similar comment
@github-actions

Copy link
Copy Markdown

Commit 95c7980 has test result changes:

bfs testsuite:

Test results comparison:
  Current:   TOTAL: 317 / PASSED: 278 / FAILED: 33 / SKIPPED: 6
  Reference: TOTAL: 317 / PASSED: 277 / FAILED: 34 / SKIPPED: 6

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

Test improvements (1):
  + gnu/inum_automount

The parser reset the regex syntax on each recursive call, so a setting
outside parentheses was ignored inside them and a setting inside was
lost after the closing parenthesis.

Share the syntax state across recursive calls. Each -regex or -iregex
still uses the setting in effect at its position on the command line.

Add regression tests for both predicates, including nested groups and
settings in short-circuited branches. All 14 cases fail before the fix
and pass after it.

Fixes uutils#933
@zhangpan2001
zhangpan2001 force-pushed the fix/933-regextype-parentheses branch from 95c7980 to f61690d Compare November 2, 2026 05:46
@sylvestre
sylvestre merged commit 2cb3ade into uutils:main Nov 2, 2026
34 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.

find: -regextype settings are lost across parentheses

2 participants