Hack fix around JWalk behaviour.

Jwalk returns '/' as a child of the current node which breaks things.
https://github.com/jessegrosjean/jwalk/issues/13
This commit is contained in:
andy.boot
2019-12-23 15:51:12 +00:00
parent 311bc45388
commit 356d14ac0f
+5
View File
@@ -125,6 +125,11 @@ fn examine_dir(
}
// This path and all its parent paths have their counter incremented
for path_name in e.path().ancestors() {
// This is required due to bug in Jwalk that adds '/' to all sub dir lists
// see: https://github.com/jessegrosjean/jwalk/issues/13
if path_name.to_string_lossy() == "/" && top_dir != "/" {
continue
}
let path_name = path_name.to_string_lossy();
let s = data.entry(path_name.to_string()).or_insert(0);
*s += size;