summaryrefslogtreecommitdiffstats
path: root/libarchive/archive_read_disk_posix.c
diff options
context:
space:
mode:
authorLibArchive Upstream <libarchive-discuss@googlegroups.com>2015-10-21 08:47:34 (GMT)
committerBrad King <brad.king@kitware.com>2015-10-21 13:37:00 (GMT)
commit1a8c7bc2c649781d1163c1966245a45e0fb829ba (patch)
tree9be1fb64019a5ef371a2f4136831e275546dc5a6 /libarchive/archive_read_disk_posix.c
parent37f225b72c8e4c440025a98f68eda9914f7ba5f7 (diff)
downloadCMake-1a8c7bc2c649781d1163c1966245a45e0fb829ba.zip
CMake-1a8c7bc2c649781d1163c1966245a45e0fb829ba.tar.gz
CMake-1a8c7bc2c649781d1163c1966245a45e0fb829ba.tar.bz2
libarchive 3.1.2-601-g3bfe5f1 (reduced)
Extract upstream libarchive using the following shell code. url=git://github.com/libarchive/libarchive.git && v=3.1.2-601-g3bfe5f1 && r=3bfe5f1 && paths=" CMakeLists.txt COPYING CTestConfig.cmake build/cmake build/pkgconfig build/utils build/version libarchive/*.* " && mkdir libarchive-$v-g$r-reduced && git clone $url libarchive-git && date=$(cd libarchive-git && git log -n 1 --format='%cd' $r) && (cd libarchive-git && git archive --format=tar $r -- $paths) | (cd libarchive-$v-g$r-reduced && tar xv) && fromdos libarchive-$v-g$r-reduced/build/cmake/Find*.cmake && echo "g$r date: $date"
Diffstat (limited to 'libarchive/archive_read_disk_posix.c')
-rw-r--r--libarchive/archive_read_disk_posix.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/libarchive/archive_read_disk_posix.c b/libarchive/archive_read_disk_posix.c
index 94eb5e7..f480539 100644
--- a/libarchive/archive_read_disk_posix.c
+++ b/libarchive/archive_read_disk_posix.c
@@ -356,6 +356,8 @@ static int _archive_read_free(struct archive *);
static int _archive_read_close(struct archive *);
static int _archive_read_data_block(struct archive *,
const void **, size_t *, int64_t *);
+static int _archive_read_next_header(struct archive *,
+ struct archive_entry **);
static int _archive_read_next_header2(struct archive *,
struct archive_entry *);
static const char *trivial_lookup_gname(void *, int64_t gid);
@@ -377,6 +379,7 @@ archive_read_disk_vtable(void)
av.archive_free = _archive_read_free;
av.archive_close = _archive_read_close;
av.archive_read_data_block = _archive_read_data_block;
+ av.archive_read_next_header = _archive_read_next_header;
av.archive_read_next_header2 = _archive_read_next_header2;
inited = 1;
}
@@ -459,6 +462,7 @@ archive_read_disk_new(void)
a->archive.magic = ARCHIVE_READ_DISK_MAGIC;
a->archive.state = ARCHIVE_STATE_NEW;
a->archive.vtable = archive_read_disk_vtable();
+ a->entry = archive_entry_new2(&a->archive);
a->lookup_uname = trivial_lookup_uname;
a->lookup_gname = trivial_lookup_gname;
a->enable_copyfile = 1;
@@ -491,6 +495,7 @@ _archive_read_free(struct archive *_a)
if (a->cleanup_uname != NULL && a->lookup_uname_data != NULL)
(a->cleanup_uname)(a->lookup_uname_data);
archive_string_free(&a->archive.error_string);
+ archive_entry_free(a->entry);
a->archive.magic = 0;
__archive_clean(&a->archive);
free(a);
@@ -609,6 +614,10 @@ archive_read_disk_set_behavior(struct archive *_a, int flags)
a->traverse_mount_points = 0;
else
a->traverse_mount_points = 1;
+ if (flags & ARCHIVE_READDISK_NO_XATTR)
+ a->suppress_xattr = 1;
+ else
+ a->suppress_xattr = 0;
return (r);
}
@@ -974,7 +983,7 @@ next_entry(struct archive_read_disk *a, struct tree *t,
t->initial_filesystem_id = t->current_filesystem_id;
if (!a->traverse_mount_points) {
if (t->initial_filesystem_id != t->current_filesystem_id)
- return (ARCHIVE_RETRY);
+ descend = 0;
}
t->descend = descend;
@@ -1081,6 +1090,17 @@ next_entry(struct archive_read_disk *a, struct tree *t,
}
static int
+_archive_read_next_header(struct archive *_a, struct archive_entry **entryp)
+{
+ int ret;
+ struct archive_read_disk *a = (struct archive_read_disk *)_a;
+ *entryp = NULL;
+ ret = _archive_read_next_header2(_a, a->entry);
+ *entryp = a->entry;
+ return ret;
+}
+
+static int
_archive_read_next_header2(struct archive *_a, struct archive_entry *entry)
{
struct archive_read_disk *a = (struct archive_read_disk *)_a;
@@ -1148,6 +1168,7 @@ _archive_read_next_header2(struct archive *_a, struct archive_entry *entry)
break;
}
+ __archive_reset_read_data(&a->archive);
return (r);
}