From: Sergey Poznyakoff Date: Mon, 2 Oct 2006 15:44:09 +0000 (+0000) Subject: (new_volume): Initialize current_block X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=f5504a3bae51922f5adffd348e5e61df2c46bcf3;p=chaz%2Ftar (new_volume): Initialize current_block --- diff --git a/src/buffer.c b/src/buffer.c index 77ebe27..57b2715 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -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 ();