mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
Fix bug for devices and apparent size
If apparent_size was set and ignore files on other devices was set then the latter flat would not work. Fix this bug
This commit is contained in:
+13
-11
@@ -173,17 +173,19 @@ fn should_ignore_file(
|
|||||||
inodes: &mut HashSet<(u64, u64)>,
|
inodes: &mut HashSet<(u64, u64)>,
|
||||||
maybe_inode: Option<(u64, u64)>,
|
maybe_inode: Option<(u64, u64)>,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
if !apparent_size {
|
|
||||||
if let Some(inode_dev_pair) = maybe_inode {
|
if let Some(inode_dev_pair) = maybe_inode {
|
||||||
// Ignore files on different devices (if flag applied)
|
// Ignore files on different devices (if flag applied)
|
||||||
if restricted_filesystems.is_some()
|
if restricted_filesystems.is_some()
|
||||||
&& !restricted_filesystems
|
&& !restricted_filesystems
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.contains(&inode_dev_pair.1)
|
.contains(&inode_dev_pair.1)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !apparent_size {
|
||||||
// Ignore files already visited or symlinked
|
// Ignore files already visited or symlinked
|
||||||
if inodes.contains(&inode_dev_pair) {
|
if inodes.contains(&inode_dev_pair) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user