Skip to content

Commit

Permalink
Filter out duplicate folders
Browse files Browse the repository at this point in the history
  • Loading branch information
jcameron committed Jun 2, 2024
1 parent 8e3ba8c commit 4b64816
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions mailbox/mailbox-lib.pl
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,22 @@ sub list_folders
}
}

# Filter out duplicate folders by inode
my @frv;
my %idone;
foreach my $f (@rv) {
if (!$f->{'file'}) {
push(@frv, $f);
}
else {
my @st = stat($f->{'file'});
if (!@st || !$done{$st[0],$st[1]}++) {
push(@frv, $f);
}
}
}
@rv = @frv;

@list_folders_cache = @rv;
return @rv;
}
Expand Down

0 comments on commit 4b64816

Please sign in to comment.