static size_t n_alloc;
static uintmax_t *sum_ent;
static uintmax_t *sum_subdir;
+ int print = 1;
/* Always define info->skip before returning. */
info->skip = excluded_filename (exclude, file + info->base);
We still have to update prev_level and maybe propagate
some sums up the hierarchy. */
size = 0;
+ print = 0;
}
else
{
if (file_type == FTW_DNR || file_type == FTW_DCH)
return 0;
+ /* If we're not counting an entry, e.g., because it's a hard link
+ to a file we've already counted (and --count-links), then don't
+ print a line for it. */
+ if (!print)
+ return 0;
+
/* FIXME: This looks suspiciously like it could be simplified. */
if ((IS_FTW_DIR_TYPE (file_type) &&
(info->level <= max_depth || info->level == 0))