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

[autofix.ci] apply automated fixes

4970654
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jun 27, 2026 in 21m 16s

Code review found 1 potential issue

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

Details

Severity Count
🔴 Important 0
🟡 Nit 1
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/glob/GlobWalker.rs:1866 Windows: trailing-backslash component loses Literal classification

Annotations

Check warning on line 1866 in src/glob/GlobWalker.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

Windows: trailing-backslash component loses Literal classification

The PR description's "no-op on Windows" claim isn't quite accurate for patterns *ending* in `\` — `build_pattern_components` includes a trailing separator in `comp_slice`, so on Windows `check_special_syntax("foo\\")` now returns true and the final component classifies as `SyntaxHint::None` instead of `Literal`. Matching is still correct (`pattern_slice()` strips `trailing_sep` before `glob::match`), and the resulting behavior is arguably *more* correct (`only_files`/`trailing_sep` are now honor