]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
tar: respect --ignore-zeros in c r & u modes when reading archives
authorRyan Libby <rlibby@FreeBSD.org>
Fri, 19 Nov 2021 09:09:35 +0000 (01:09 -0800)
committerRyan Libby <rlibby@FreeBSD.org>
Fri, 19 Nov 2021 09:09:35 +0000 (01:09 -0800)
Previously, --ignore-zeros was only being applied to t and x modes.

tar/write.c

index 09c44a3e747be1e0898eca5a53ff67803ad3d5a9..f2fb1c356c13efbafc933c62eac651505f55a995 100644 (file)
@@ -196,6 +196,10 @@ set_reader_options(struct bsdtar *bsdtar, struct archive *a)
                else
                        archive_clear_error(a);
        }
+       if (bsdtar->flags & OPTFLAG_IGNORE_ZEROS)
+               if (archive_read_set_options(a,
+                   "read_concatenated_archives") != ARCHIVE_OK)
+                       lafe_errc(1, 0, "%s", archive_error_string(a));
 }
 
 void