Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glob::glob not match "./*.rs" #12930

Closed
electricface opened this issue Mar 16, 2014 · 1 comment · Fixed by #13383
Closed

glob::glob not match "./*.rs" #12930

electricface opened this issue Mar 16, 2014 · 1 comment · Fixed by #13383

Comments

@electricface
Copy link

extern crate glob;
use glob::glob;

fn main(){
    let v = ["./*.rs","*.rs"];
    for i in v.iter() {
        puts!("glob result: " + *i );
        for path in glob( *i ) {
            println!("{}",path.display());
        }
    }
}

output :

glob result: ./*.rs
glob result: *.rs
/home/time/rust/a.rs
/home/time/rust/b.rs
/home/time/rust/c.rs
/home/time/rust/ele_macros.rs
/home/time/rust/getopts.rs
/home/time/rust/main.rs
/home/time/rust/world.rs

rustc 0.10-pre
host: x86_64-unknown-linux-gnu

@ben0x539
Copy link
Contributor

ben0x539 commented Apr 6, 2014

Looks like libglob is generating a list of candidate paths by listing entries in the current directory, and then matching those component for component against the provided glob. Since paths are always normalized, . and .. in a glob can't possibly match.

I'm vaguely looking at fixing this but I can't see any clever way to do it right now.

@bors bors closed this as completed in e2c84a7 Apr 9, 2014
lnicola pushed a commit to lnicola/rust that referenced this issue Aug 9, 2022
minor: Use the release branch in xtask promote
flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 27, 2024
…tion, r=Jarcho

[`missing_const_for_fn`]: add machine-applicable suggestion

Add a machine-applicable suggestion to the `missing_const_for_fn` lint.

changelog: [`missing_const_for_fn`]: add machine-applicable suggestion
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 a pull request may close this issue.

3 participants