]> git.ipfire.org Git - thirdparty/tar.git/commitdiff
Fix verbose ACL listing
authorSergey Poznyakoff <gray@gnu.org>
Mon, 12 Nov 2018 07:15:22 +0000 (09:15 +0200)
committerSergey Poznyakoff <gray@gnu.org>
Mon, 12 Nov 2018 07:17:25 +0000 (09:17 +0200)
* src/xattrs.c (acls_one_line): Advance pos.
(xattrs_print): Insert a comma between ACL and default ACL if both
are non-empty.

src/xattrs.c

index 5049d08bc121fd526776149d76e5662c59046b7b..d7e4701eed07cbc6d06eb28addb4098468360190 100644 (file)
@@ -336,6 +336,7 @@ acls_one_line (const char *prefix, char delim,
       obstack_grow (&stk, prefix, pref_len);
       obstack_grow (&stk, aclstring, move);
 
+      pos += move + 1;
       aclstring += move + 1;
     }
 
@@ -740,6 +741,8 @@ xattrs_print (struct tar_stat_info const *st)
     {
       fprintf (stdlis, "  a: ");
       acls_one_line ("", ',', st->acls_a_ptr, st->acls_a_len);
+      if (st->acls_a_len && st->acls_d_len)
+       fprintf (stdlis, ",");
       acls_one_line ("default:", ',', st->acls_d_ptr, st->acls_d_len);
       fprintf (stdlis, "\n");
     }