X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Flist.c;h=06ccf2d8465dce24152c20d6bc4bbcf8db433a49;hb=68bd7ac50a26c795ba9cbaa9d18e26c35f10c09c;hp=eb5f9bac0602205e4c2629df397e2bf5d0441e5e;hpb=2bda83b48d8a6807632312403561b11b79048443;p=chaz%2Ftar diff --git a/src/list.c b/src/list.c index eb5f9ba..06ccf2d 100644 --- a/src/list.c +++ b/src/list.c @@ -118,6 +118,8 @@ read_and (void (*do_something) (void)) quotearg_colon (current_stat_info.file_name))); /* Fall through. */ default: + decode_header (current_header, + ¤t_stat_info, ¤t_format, 0); skip_member (); continue; } @@ -171,6 +173,15 @@ read_and (void (*do_something) (void)) case HEADER_ZERO_BLOCK: case HEADER_SUCCESS: + if (block_number_option) + { + char buf[UINTMAX_STRSIZE_BOUND]; + off_t block_ordinal = current_block_ordinal (); + block_ordinal -= recent_long_name_blocks; + block_ordinal -= recent_long_link_blocks; + fprintf (stdlis, _("block %s: "), + STRINGIFY_BIGINT (block_ordinal, buf)); + } ERROR ((0, 0, _("Skipping to next header"))); break; @@ -1193,7 +1204,7 @@ print_header (struct tar_stat_info *st, off_t block_ordinal) /* Print a similar line when we make a directory automatically. */ void -print_for_mkdir (char *pathname, int length, mode_t mode) +print_for_mkdir (char *dirname, int length, mode_t mode) { char modes[11]; @@ -1212,7 +1223,7 @@ print_for_mkdir (char *pathname, int length, mode_t mode) } fprintf (stdlis, "%s %*s %.*s\n", modes, ugswidth + DATEWIDTH, - _("Creating directory:"), length, quotearg (pathname)); + _("Creating directory:"), length, quotearg (dirname)); } } @@ -1228,6 +1239,19 @@ skip_file (off_t size) save_sizeleft = size; } + if (seekable_archive) + { + off_t nblk = seek_archive (size); + if (nblk >= 0) + { + size -= nblk * BLOCKSIZE; + if (multi_volume_option) /* Argh.. */ + save_sizeleft -= nblk * BLOCKSIZE; + } + else + seekable_archive = false; + } + while (size > 0) { x = find_next_block (); @@ -1241,16 +1265,17 @@ skip_file (off_t size) } } -/* Skip the current member in the archive. */ +/* Skip the current member in the archive. + NOTE: Current header must be decoded before calling this function. */ void 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); - if (sparse_member_p (¤t_stat_info)) + if (current_stat_info.is_sparse) sparse_skip_file (¤t_stat_info); else if (save_typeflag != DIRTYPE) skip_file (current_stat_info.stat.st_size);