static time_t current_time = TYPE_MINIMUM (time_t);
static int current_time_ns = -1;
+/* Whether any of the files has an ACL. This affects the width of the
+ mode column. */
+
+#if HAVE_ACL
+static bool any_has_acl;
+#else
+enum { any_has_acl = false };
+#endif
+
/* The number of columns to use for columns containing inode numbers,
block sizes, link counts, owners, groups, authors, major device
numbers, minor device numbers, and file sizes, respectively. */
}
files_index = 0;
+#if HAVE_ACL
+ any_has_acl = false;
+#endif
inode_number_width = 0;
block_size_width = 0;
nlink_width = 0;
{
int n = file_has_acl (absolute_name, &f->stat);
f->have_acl = (0 < n);
+ any_has_acl |= f->have_acl;
if (n < 0)
error (0, errno, "%s", quotearg_colon (absolute_name));
}
mode_string (ST_DM_MODE (f->stat), modebuf);
modebuf[10] = (FILE_HAS_ACL (f) ? '+' : ' ');
- modebuf[11] = '\0';
+ modebuf[10 + any_has_acl] = '\0';
switch (time_type)
{
sprintf (p, "%s %*s ", modebuf, nlink_width,
umaxtostr (f->stat.st_nlink, hbuf));
}
- p += sizeof modebuf + nlink_width + 1;
+ p += sizeof modebuf - 2 + any_has_acl + 1 + nlink_width + 1;
DIRED_INDENT ();