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
Two problems with the raw prefix compare:
/runexclude also skips/runtime-dataand anything else starting with those four charactersc:\windows\winsxsnever matches theC:\Windows\WinSxSexclude and the component store gets walked anywayrules::classifyalready 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