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:
andy.boot
2020-02-09 13:41:58 +00:00
parent 2082141dfc
commit b6aa1378de
+3 -1
View File
@@ -173,7 +173,7 @@ 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()
@@ -184,6 +184,8 @@ fn should_ignore_file(
{ {
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;