Skip to content

Exclude paths are matched as raw string prefixes #46

Description

@Muawiya-contact
fn is_excluded(path: &Path, excludes: &[String]) -> bool {
    let p = path.to_string_lossy();
    excludes.iter().any(|ex| p.starts_with(ex.as_str()))
}

Two problems with the raw prefix compare:

  • no component boundary, so the /run exclude also skips /runtime-data and anything else starting with those four characters
  • no case normalization, so a root given as c:\windows\winsxs never matches the C:\Windows\WinSxS exclude and the component store gets walked anyway

rules::classify already normalizes (lowercase, \ to /) before matching. The excludes should go through the same normalization, and compare on path components rather than characters.

crates/diskern-core/src/scanner.rs:126

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomersrustPull requests that update rust code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions