]> Dogcows Code - chaz/tar/blobdiff - src/extract.c
Use mv_.* functions uniformly instead of fiddling with the global variables.
[chaz/tar] / src / extract.c
index fbb93edd8a85a864feaadd85807841e7faed9e96..3ef7f2883b562d63a88adcafc0d827a85073e9e6 100644 (file)
@@ -739,37 +739,33 @@ extract_file (char *file_name, int typeflag)
        }
     }
 
+  mv_begin (&current_stat_info);
   if (current_stat_info.is_sparse)
     sparse_extract_file (fd, &current_stat_info, &size);
   else
     for (size = current_stat_info.stat.st_size; size > 0; )
       {
-       if (multi_volume_option)
-         {
-           assign_string (&save_name, current_stat_info.orig_file_name);
-           save_totsize = current_stat_info.stat.st_size;
-           save_sizeleft = size;
-         }
-
+       mv_size_left (size);
+       
        /* Locate data, determine max length writeable, write it,
           block that we have used the data, then check if the write
           worked.  */
-
+       
        data_block = find_next_block ();
        if (! data_block)
          {
            ERROR ((0, 0, _("Unexpected EOF in archive")));
            break;              /* FIXME: What happens, then?  */
          }
-
+       
        written = available_space_after (data_block);
-
+       
        if (written > size)
          written = size;
        errno = 0;
        count = full_write (fd, data_block->buffer, written);
        size -= written;
-
+       
        set_next_block_after ((union block *)
                              (data_block->buffer + written - 1));
        if (count != written)
@@ -783,9 +779,8 @@ extract_file (char *file_name, int typeflag)
 
   skip_file (size);
 
-  if (multi_volume_option)
-    assign_string (&save_name, 0);
-
+  mv_end ();
+  
   /* If writing to stdout, don't try to do anything to the filename;
      it doesn't exist, or we don't want to touch it anyway.  */
 
This page took 0.022277 seconds and 4 git commands to generate.