Skip to content

glob: honour backslash escapes of non-special characters in scan() - #32876

Open
robobun wants to merge 5 commits into
mainfrom
farm/4badb7cf/glob-scan-backslash-escape
Open

glob: honour backslash escapes of non-special characters in scan()#32876
robobun wants to merge 5 commits into
mainfrom
farm/4badb7cf/glob-scan-backslash-escape

glob: treat backslash as special syntax in scan component classification

488026a
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jun 27, 2026 in 27m 13s

Code review found 1 potential issue

Found 1 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 0
🟣 Pre-existing 1
Severity File:Line Issue
🟣 Pre-existing src/glob/GlobWalker.rs:1942-1948 WildcardFilepath bailout loop scans past component end

Annotations

Check notice on line 1948 in src/glob/GlobWalker.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

WildcardFilepath bailout loop scans past component end

Pre-existing nit (perf-only): this loop iterates `pattern[(component.start + 2)..]` to the end of the **full** pattern string rather than to `(component.start + component.len)`, so a special token in a *later* component (e.g. the second `*` in `*.ts/*.js`, or now a `\` in `*.ts/foo\ bar`) defeats the `WildcardFilepath` fast path for the earlier `*.ts` component. Since this PR touches the match arm anyway, you could tighten the slice to `&pattern[(component.start + 2) as usize..(component.start +