mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
Apparent size mode: handle hard links.
If we are viewing apparent size then each hard linked file should be counted. Not just the first one.
This commit is contained in:
@@ -56,12 +56,14 @@ fn examine_dir(
|
|||||||
match (file_type, maybe_size_and_inode) {
|
match (file_type, maybe_size_and_inode) {
|
||||||
(Some(file_type), Some((size, inode))) => {
|
(Some(file_type), Some((size, inode))) => {
|
||||||
let s = d.path().to_string_lossy().to_string();
|
let s = d.path().to_string_lossy().to_string();
|
||||||
|
if !apparent_size {
|
||||||
if let Some(inode_dev_pair) = inode {
|
if let Some(inode_dev_pair) = inode {
|
||||||
if inodes.contains(&inode_dev_pair) {
|
if inodes.contains(&inode_dev_pair) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
inodes.insert(inode_dev_pair);
|
inodes.insert(inode_dev_pair);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if d.path().is_dir() && !file_type.is_symlink() {
|
if d.path().is_dir() && !file_type.is_symlink() {
|
||||||
let (hp, recursive) =
|
let (hp, recursive) =
|
||||||
|
|||||||
Reference in New Issue
Block a user