]> Dogcows Code - chaz/tar/blobdiff - src/sparse.c
(pax_sparse_member_p): Checking member size vs. file size is not reliable enough...
[chaz/tar] / src / sparse.c
index ecbbe108842bbd27366b3d16a470fc4e047a474e..0955248c492a9e75cb767edd81d17693cfde9bb0 100644 (file)
@@ -102,6 +102,7 @@ tar_sparse_member_p (struct tar_sparse_file *file)
 static bool
 tar_sparse_init (struct tar_sparse_file *file)
 {
+  file->dumped_size = 0;
   if (file->optab->init)
     return file->optab->init (file);
   return true;
@@ -216,6 +217,8 @@ sparse_scan_file (struct tar_sparse_file *file)
   if (!lseek_or_error (file, 0))
     return false;
 
+  st->archive_file_size = 0;
+  
   if (!tar_sparse_scan (file, scan_begin, NULL))
     return false;
 
@@ -842,7 +845,7 @@ static struct tar_sparse_optab const star_optab = {
 static bool
 pax_sparse_member_p (struct tar_sparse_file *file)
 {
-  return file->stat_info->archive_file_size != file->stat_info->stat.st_size;
+  return file->stat_info->sparse_map_avail > 0;
 }
 
 static bool
This page took 0.026545 seconds and 4 git commands to generate.