From: Tim Kientzle Date: Thu, 26 Mar 2009 06:25:35 +0000 (-0400) Subject: Set options before opening the archive. X-Git-Tag: v2.7.0~83 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d100c828dc0773bd5eede181d9cc5a0b4e54d2d0;p=thirdparty%2Flibarchive.git Set options before opening the archive. SVN-Revision: 858 --- diff --git a/tar/read.c b/tar/read.c index 5f25974d3..642c548b4 100644 --- a/tar/read.c +++ b/tar/read.c @@ -127,17 +127,13 @@ read_archive(struct bsdtar *bsdtar, char mode) else archive_read_support_compression_all(a); archive_read_support_format_all(a); + if (ARCHIVE_OK != archive_read_set_options(a, bsdtar->option_options)) + bsdtar_errc(bsdtar, 1, 0, archive_error_string(a)); if (archive_read_open_file(a, bsdtar->filename, bsdtar->bytes_per_block != 0 ? bsdtar->bytes_per_block : DEFAULT_BYTES_PER_BLOCK)) bsdtar_errc(bsdtar, 1, 0, "Error opening archive: %s", archive_error_string(a)); - if (bsdtar->option_options != NULL) { - r = archive_read_set_options(a, bsdtar->option_options); - if (r != ARCHIVE_OK) - bsdtar_errc(bsdtar, 1, 0, "Error archive options: %s", - archive_error_string(a)); - } do_chdir(bsdtar);