(clear_files): Clear it.
(gobble_file): Set it if a file has an ACL.
(print_long_format): Omit needless space unless some file has an ACL.
static time_t current_time = TYPE_MINIMUM (time_t);
static int current_time_ns = -1;
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. */
/* 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. */
+#if HAVE_ACL
+ any_has_acl = false;
+#endif
inode_number_width = 0;
block_size_width = 0;
nlink_width = 0;
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);
{
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));
}
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) ? '+' : ' ');
mode_string (ST_DM_MODE (f->stat), modebuf);
modebuf[10] = (FILE_HAS_ACL (f) ? '+' : ' ');
+ modebuf[10 + any_has_acl] = '\0';
sprintf (p, "%s %*s ", modebuf, nlink_width,
umaxtostr (f->stat.st_nlink, hbuf));
}
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;