]> Dogcows Code - chaz/tar/blobdiff - src/list.c
Started merging with cpio into paxutils.
[chaz/tar] / src / list.c
index e2746bc72445676762fe215c8b391aa9b284d332..0e5e205f9a4f43feb8a7fa052c4a7509c733335a 100644 (file)
@@ -22,7 +22,7 @@
 /* Define to non-zero for forcing old ctime format instead of ISO format.  */
 #undef USE_OLD_CTIME
 
-#include "system.h"
+#include <system.h>
 #include <quotearg.h>
 
 #include "common.h"
@@ -118,6 +118,8 @@ read_and (void (*do_something) (void))
                           quotearg_colon (current_stat_info.file_name)));
                  /* Fall through.  */
                default:
+                 decode_header (current_header,
+                                &current_stat_info, &current_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
@@ -1202,7 +1206,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];
 
@@ -1221,7 +1225,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));
     }
 }
 
@@ -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 (&current_stat_info))
+  if (current_stat_info.is_sparse)
     sparse_skip_file (&current_stat_info);
   else if (save_typeflag != DIRTYPE)
     skip_file (current_stat_info.stat.st_size);
This page took 0.021955 seconds and 4 git commands to generate.