/* List a tar archive, with support routines for reading a tar archive.
Copyright (C) 1988, 1992, 1993, 1994, 1996, 1997, 1998, 1999, 2000,
- 2001, 2003, 2004, 2005, 2006, 2007, 2010 Free Software Foundation, Inc.
+ 2001, 2003, 2004, 2005, 2006, 2007, 2010, 2012
+ Free Software Foundation, Inc.
Written by John Gilmore, on 1985-08-26.
return transform_name_fp (pinput, type, decode_xform, &type);
}
-static void
+void
transform_stat_info (int typeflag, struct tar_stat_info *stat_info)
{
if (typeflag == GNUTYPE_VOLHDR)
/* Name transformations don't apply to volume headers. */
return;
-
+
transform_member_name (&stat_info->file_name, XFORM_REGFILE);
switch (typeflag)
{
if (header->header.typeflag == GNUTYPE_LONGNAME)
{
- if (next_long_name)
- free (next_long_name);
+ free (next_long_name);
next_long_name = header_copy;
next_long_name_blocks = size / BLOCKSIZE;
}
else
{
- if (next_long_link)
- free (next_long_link);
+ free (next_long_link);
next_long_link = header_copy;
next_long_link_blocks = size / BLOCKSIZE;
}
struct posix_header const *h = &header->header;
char namebuf[sizeof h->prefix + 1 + NAME_FIELD_SIZE + 1];
- if (recent_long_name)
- free (recent_long_name);
+ free (recent_long_name);
if (next_long_name)
{
assign_string (&info->file_name, name);
info->had_trailing_slash = strip_trailing_slashes (info->file_name);
- if (recent_long_link)
- free (recent_long_link);
+ free (recent_long_link);
if (next_long_link)
{
else
format = USTAR_FORMAT;
}
- else if (strcmp (header->header.magic, OLDGNU_MAGIC) == 0)
+ else if (strcmp (header->buffer + offsetof (struct posix_header, magic),
+ OLDGNU_MAGIC)
+ == 0)
format = hbits ? OLDGNU_FORMAT : GNU_FORMAT;
else
format = V7_FORMAT;
assign_string (&stat_info->gname,
header->header.gname[0] ? header->header.gname : NULL);
+ xheader_xattr_init (stat_info);
+
if (format == OLDGNU_FORMAT && incremental_option)
{
stat_info->atime.tv_sec = TIME_FROM_HEADER (header->oldgnu_header.atime);
simple_print_header (struct tar_stat_info *st, union block *blk,
off_t block_ordinal)
{
- char modes[11];
+ char modes[12];
char const *time_stamp;
int time_stamp_len;
char *temp_name;
pax_decode_mode (st->stat.st_mode, modes + 1);
+ /* extended attributes: GNU `ls -l'-like preview */
+ xattrs_print_char (st, modes + 10);
+
/* Time stamp. */
time_stamp = tartime (st->mtime, full_time_option);
}
}
fflush (stdlis);
+ xattrs_print (st);
}
STRINGIFY_BIGINT (current_block_ordinal (), buf));
}
- fprintf (stdlis, "%s %*s %.*s\n", modes, ugswidth + 1 + datewidth,
- _("Creating directory:"), length, quotearg (dirname));
+ fprintf (stdlis, "%s %*s %s\n", modes, ugswidth + 1 + datewidth,
+ _("Creating directory:"), quotearg (dirname));
}
}
}
void
-test_archive_label ()
+test_archive_label (void)
{
base64_init ();
name_gather ();