X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Ftar.c;h=8b35c58bf43bb6e7f69e37710b07d9785dbf8ef7;hb=f4e4adea80a;hp=e2df10fca8cb5a98b7d5280bbbe71cb12551242a;hpb=1001c1b3266574be6e024d0f70a3bd035d569643;p=chaz%2Ftar diff --git a/src/tar.c b/src/tar.c index e2df10f..8b35c58 100644 --- a/src/tar.c +++ b/src/tar.c @@ -384,7 +384,7 @@ static struct argp_option options[] = { {"sparse", 'S', 0, 0, N_("handle sparse files efficiently"), GRID+1 }, {"sparse-version", SPARSE_VERSION_OPTION, N_("MAJOR[.MINOR]"), 0, - N_("set version of the sparse format to use"), GRID+1}, + N_("set version of the sparse format to use (implies --sparse)"), GRID+1}, {"incremental", 'G', 0, 0, N_("handle old GNU-format incremental backup"), GRID+1 }, {"listed-incremental", 'g', N_("FILE"), 0, @@ -1327,7 +1327,7 @@ parse_opt (int key, char *arg, struct argp_state *state) /* Print block numbers for debugging bad tar archives. */ /* It would surely make sense to exchange -B and -R, but it seems - that -B has been used for a long while in Sun tar ans most + that -B has been used for a long while in Sun tar and most BSD-derived systems. This is a consequence of the block/record terminology confusion. */ @@ -1335,7 +1335,7 @@ parse_opt (int key, char *arg, struct argp_state *state) break; case 's': - /* Names to extr are sorted. */ + /* Names to extract are sorted. */ same_order_option = true; break; @@ -1345,6 +1345,7 @@ parse_opt (int key, char *arg, struct argp_state *state) break; case SPARSE_VERSION_OPTION: + sparse_option = true; { char *p; tar_sparse_major = strtoul (arg, &p, 10); @@ -2037,13 +2038,6 @@ decode_options (int argc, char **argv) | FORMAT_MASK (GNU_FORMAT) | FORMAT_MASK (POSIX_FORMAT)); - if (multi_volume_option - && archive_format == POSIX_FORMAT - && subcommand_option == CREATE_SUBCOMMAND - && !tape_length_option) - USAGE_ERROR ((0, 0, - _("creating multi-volume archives in posix format requires using --tape-length (-L) option"))); - if (occurrence_option) { if (!args.input_files) @@ -2197,6 +2191,16 @@ decode_options (int argc, char **argv) break; } + /* Initialize stdlis */ + if (index_file_name) + { + stdlis = fopen (index_file_name, "w"); + if (! stdlis) + open_error (index_file_name); + } + else + stdlis = to_stdout_option ? stderr : stdout; + archive_name_cursor = archive_name_array; /* Prepare for generating backup names. */ @@ -2239,6 +2243,9 @@ main (int argc, char **argv) /* Make sure we have first three descriptors available */ stdopen (); + /* Close all inherited open descriptors, except for the first three */ + closeopen (); + /* Pre-allocate a few structures. */ allocated_archive_names = 10;