Skip to content

globset does not match non-ascii in character class #2873

@Dav1dde

Description

@Dav1dde

The following code fails the assertion, where I would expect it to succeed.

assert!(globset::Glob::new("[ඞ]").unwrap().compile_matcher().is_match("ඞ"));

The problem appears to be the escaping here:

re.push_str(&char_to_escaped_literal(r.0));

I can PR this and remove the escaping if you think this is the correct fix. Although some escaping would still be necessary, for example for the pattern [\\], the \ still needs to be escaped.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions