]> Dogcows Code - chaz/tar/commitdiff
(new_volume): Initialize current_block
authorSergey Poznyakoff <gray@gnu.org.ua>
Mon, 2 Oct 2006 15:44:09 +0000 (15:44 +0000)
committerSergey Poznyakoff <gray@gnu.org.ua>
Mon, 2 Oct 2006 15:44:09 +0000 (15:44 +0000)
src/buffer.c

index 77ebe272f14b827a26f6506b587787917ee45b11..57b271527ba3d4c64dbad00d04ba92ed9cfb44c2 100644 (file)
@@ -1020,7 +1020,8 @@ new_volume (enum access_mode mode)
   assign_string (&volume_label, NULL);
   assign_string (&continued_file_name, NULL);
   continued_file_size = continued_file_offset = 0;
-
+  current_block = record_start;
+  
   if (rmtclose (archive) != 0)
     close_warn (*archive_name_cursor);
 
@@ -1114,22 +1115,24 @@ try_new_volume ()
   size_t status;
   union block *header;
   struct tar_stat_info dummy;
-       
+  int access;
+  
   switch (subcommand_option)
     {
     case APPEND_SUBCOMMAND:
     case CAT_SUBCOMMAND:
     case UPDATE_SUBCOMMAND:
-      if (!new_volume (ACCESS_UPDATE))
-       return true;
+      access = ACCESS_UPDATE;
       break;
 
     default:
-      if (!new_volume (ACCESS_READ))
-       return true;
+      access = ACCESS_READ;
       break;
     }
 
+  if (!new_volume (access))
+    return true;
+  
   while ((status = rmtread (archive, record_start->buffer, record_size))
         == SAFE_READ_ERROR)
     archive_read_error ();
This page took 0.030972 seconds and 4 git commands to generate.