summaryrefslogtreecommitdiff
path: root/tar/read.c
diff options
context:
space:
mode:
authorTim Kientzle <kientzle@gmail.com>2009-03-26 02:25:35 -0400
committerTim Kientzle <kientzle@gmail.com>2009-03-26 02:25:35 -0400
commitd100c828dc0773bd5eede181d9cc5a0b4e54d2d0 (patch)
tree4d33a281b3e75fedd6303701421e770766f490dd /tar/read.c
parent949feea6d731b66337148beed3738e5a6bdb25f5 (diff)
downloadlibarchive-d100c828dc0773bd5eede181d9cc5a0b4e54d2d0.tar.gz
Set options before opening the archive.
SVN-Revision: 858
Diffstat (limited to 'tar/read.c')
-rw-r--r--tar/read.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/tar/read.c b/tar/read.c
index 5f25974d..642c548b 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);