X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Flist.c;h=e56e7dce930d5e42c92aff77a1857c37fa1b6192;hb=5c35fdb275b519373e6eb34621d956d09a52bf31;hp=e0f5080876c623e25e11f945c4b06c606be2b0c0;hpb=8f0112cb2365f4635895014debbf9355f6b54ecf;p=chaz%2Ftar diff --git a/src/list.c b/src/list.c index e0f5080..e56e7dc 100644 --- a/src/list.c +++ b/src/list.c @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Define to non-zero for forcing old ctime format instead of ISO format. */ #undef USE_OLD_CTIME @@ -222,7 +222,7 @@ list_archive (void) set_next_block_after (current_header); if (multi_volume_option) { - assign_string (&save_name, current_stat_info.file_name); + assign_string (&save_name, current_stat_info.orig_file_name); save_totsize = current_stat_info.stat.st_size; } for (size = current_stat_info.stat.st_size; size > 0; size -= written) @@ -258,7 +258,7 @@ list_archive (void) } if (multi_volume_option) - assign_string (&save_name, current_stat_info.file_name); + assign_string (&save_name, current_stat_info.orig_file_name); skip_member (); @@ -369,7 +369,8 @@ read_header (bool raw_extended_headers) if (header->header.typeflag == GNUTYPE_LONGNAME || header->header.typeflag == GNUTYPE_LONGLINK || header->header.typeflag == XHDTYPE - || header->header.typeflag == XGLTYPE) + || header->header.typeflag == XGLTYPE + || header->header.typeflag == SOLARIS_XHDTYPE) { if (raw_extended_headers) return HEADER_SUCCESS_EXTENDED; @@ -427,7 +428,8 @@ read_header (bool raw_extended_headers) *bp = '\0'; } - else if (header->header.typeflag == XHDTYPE) + else if (header->header.typeflag == XHDTYPE + || header->header.typeflag == SOLARIS_XHDTYPE) xheader_read (header, OFF_FROM_HEADER (header->header.size)); else if (header->header.typeflag == XGLTYPE) { @@ -465,11 +467,6 @@ read_header (bool raw_extended_headers) np[sizeof h->prefix] = '\0'; np += strlen (np); *np++ = '/'; - - /* Prevent later references to current_header from - mistakenly treating this as an old GNU header. - This assignment invalidates h->prefix. */ - current_header->oldgnu_header.isextended = 0; } memcpy (np, h->name, sizeof h->name); np[sizeof h->name] = '\0'; @@ -923,18 +920,6 @@ uintmax_from_header (const char *p, size_t s) } -/* Format O as a null-terminated decimal string into BUF _backwards_; - return pointer to start of result. */ -char * -stringify_uintmax_t_backwards (uintmax_t o, char *buf) -{ - *--buf = '\0'; - do - *--buf = '0' + (int) (o % 10); - while ((o /= 10) != 0); - return buf; -} - /* Return a printable representation of T. The result points to static storage that can be reused in the next call to this function, to ctime, or to asctime. */ @@ -1095,7 +1080,7 @@ print_header (struct tar_stat_info *st, off_t block_ordinal) break; } - decode_mode (st->stat.st_mode, modes + 1); + pax_decode_mode (st->stat.st_mode, modes + 1); /* Time stamp. */ @@ -1103,7 +1088,9 @@ print_header (struct tar_stat_info *st, off_t block_ordinal) /* User and group names. */ - if (st->uname && current_format != V7_FORMAT + if (st->uname + && st->uname[0] + && current_format != V7_FORMAT && !numeric_owner_option) user = st->uname; else @@ -1126,7 +1113,9 @@ print_header (struct tar_stat_info *st, off_t block_ordinal) } } - if (st->gname && current_format != V7_FORMAT + if (st->gname + && st->gname[0] + && current_format != V7_FORMAT && !numeric_owner_option) group = st->gname; else @@ -1250,7 +1239,7 @@ print_for_mkdir (char *dirname, int length, mode_t mode) /* File type and modes. */ modes[0] = 'd'; - decode_mode (mode, modes + 1); + pax_decode_mode (mode, modes + 1); if (block_number_option) { @@ -1310,7 +1299,7 @@ skip_member (void) char save_typeflag = current_header->header.typeflag; set_next_block_after (current_header); - assign_string (&save_name, current_stat_info.file_name); + assign_string (&save_name, current_stat_info.orig_file_name); if (current_stat_info.is_sparse) sparse_skip_file (¤t_stat_info);