Change size of softlinks to 0

Instead of the size of what they point at
This commit is contained in:
andy.boot
2021-07-15 13:44:07 +01:00
parent 42163abb73
commit 3dad7abfb8
2 changed files with 15 additions and 2 deletions
+9 -1
View File
@@ -15,11 +15,19 @@ pub fn build_node(
dir: PathBuf,
children: Vec<Node>,
use_apparent_size: bool,
is_symlink: bool,
by_filecount: bool,
) -> Option<Node> {
match get_metadata(&dir, use_apparent_size) {
Some(data) => {
let (size, inode_device) = if by_filecount { (1, data.1) } else { data };
let (size, inode_device) = if by_filecount {
(1, data.1)
} else if is_symlink && !use_apparent_size {
(0, None)
} else {
data
};
Some(Node {
name: dir,
size,