{
const char *arg;
struct archive_entry *entry, *sparse_entry;
- struct archive *disk, *disk_saved;
/* Choose a suitable copy buffer size */
bsdtar->buff_size = 64 * 1024;
bsdtar->argv++;
}
+ archive_read_disk_set_matching(bsdtar->diskreader, NULL, NULL, NULL);
+ archive_read_disk_set_metadata_filter_callback(
+ bsdtar->diskreader, NULL, NULL);
entry = NULL;
- disk = NULL;
- disk_saved = bsdtar->diskreader;
archive_entry_linkify(bsdtar->resolver, &entry, &sparse_entry);
while (entry != NULL) {
int r;
struct archive_entry *entry2;
+ struct archive *disk = bsdtar->diskreader;
/*
* This tricky code here is to correctly read the cotents
* is pointing at does not have any information about the
* entry by this time and using archive_read_data_block()
* with the disk reader consequently must fail. And we
- * have to create a new disk reader object to read the
- * contents.
+ * have to re-open the entry to read the contents.
*/
- if (disk == NULL && (disk = archive_read_disk_new()) == NULL)
- lafe_errc(1, 0, "Cannot create read_disk object");
- else
- bsdtar->diskreader = disk;
-
/* TODO: Work with -C option as well. */
r = archive_read_disk_open(disk,
archive_entry_sourcepath(entry));
entry = NULL;
archive_entry_linkify(bsdtar->resolver, &entry, &sparse_entry);
}
- bsdtar->diskreader = disk_saved;
- if (disk != NULL)
- archive_read_free(disk);
if (archive_write_close(a)) {
lafe_warnc(0, "%s", archive_error_string(a));