'*' broken in Pattern::matches_path
Open
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 595
- Forks
- 93
- PR merge metrics
- No merged PRs in 30d
Description
Here's a recursive file list:
$find src
src/
src/main.rs
src/a/
src/a/b.rs
Running this program
extern crate glob;
use std::path::Path;
use glob::{Pattern,glob};
fn main() {
let pattern="src/*.rs";
println!("matches src/a/b.rs: {}",Pattern::new(pattern).unwrap().matches_path(Path::new("src/a/b.rs")));
for entry in glob(pattern).unwrap() {
println!("globbed: {}", entry.unwrap().display());
}
}
outputs
matches src/a/b.rs: true
globbed: src/main.rs
Note it DID NOT output globbed: src/a/b.rs. Meaning glob and Pattern::matches_path are inconsistent here. I think glob is correct as '*' should not match across slashes.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the provided Rust reproduction and compare Pattern::matches_path with glob for the pattern src/.rs and nested paths. Trace both matching paths to identify why '' crosses slashes in one case; done means the two APIs agree and the nested src/a/b.rs case is excluded.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100