]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Set options before opening the archive.
authorTim Kientzle <kientzle@gmail.com>
Thu, 26 Mar 2009 06:25:35 +0000 (02:25 -0400)
committerTim Kientzle <kientzle@gmail.com>
Thu, 26 Mar 2009 06:25:35 +0000 (02:25 -0400)
SVN-Revision: 858

tar/read.c

index 5f25974d3c7402a43c080027a18d27ae80103980..642c548b4278d02fc484efff755d6338d2bb56f8 100644 (file)
@@ -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);