X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Flist.c;h=61a3f85f7b738e8b0e1075cdaa0f2ae5938d0b4f;hb=da3f3e0b3ba1a283787845d1553c5bb1a096533f;hp=cb207a982b9633eec275daf8ca8fa287139f3002;hpb=463d99453f51ac4ae875d9bae97418671e7a62bc;p=chaz%2Ftar diff --git a/src/list.c b/src/list.c index cb207a9..61a3f85 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; } @@ -595,6 +597,8 @@ decode_header (union block *header, struct tar_stat_info *stat_info, sparse_fixup_header (stat_info); stat_info->is_sparse = true; } + else + stat_info->is_sparse = false; } /* Convert buffer at WHERE0 of size DIGS from external format to @@ -1237,6 +1241,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 (); @@ -1250,16 +1267,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);