From b6aa1378de8b8ba810caa600febf7f9f0c5f6b6f Mon Sep 17 00:00:00 2001 From: "andy.boot" Date: Sun, 9 Feb 2020 13:41:58 +0000 Subject: [PATCH] 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 --- src/utils/mod.rs | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/utils/mod.rs b/src/utils/mod.rs index 609d522..0291c14 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -173,17 +173,19 @@ fn should_ignore_file( inodes: &mut HashSet<(u64, u64)>, maybe_inode: Option<(u64, u64)>, ) -> bool { - if !apparent_size { - if let Some(inode_dev_pair) = maybe_inode { - // Ignore files on different devices (if flag applied) - if restricted_filesystems.is_some() - && !restricted_filesystems - .as_ref() - .unwrap() - .contains(&inode_dev_pair.1) - { - return true; - } + + if let Some(inode_dev_pair) = maybe_inode { + // Ignore files on different devices (if flag applied) + if restricted_filesystems.is_some() + && !restricted_filesystems + .as_ref() + .unwrap() + .contains(&inode_dev_pair.1) + { + return true; + } + + if !apparent_size { // Ignore files already visited or symlinked if inodes.contains(&inode_dev_pair) { return true;