mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
Change size of softlinks to 0
Instead of the size of what they point at
This commit is contained in:
+9
-1
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user