diff options
author | joerg <joerg@pkgsrc.org> | 2019-09-22 09:51:28 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2019-09-22 09:51:28 +0000 |
commit | 85efd7f8759590df15b06d680dc2c141a499d7d3 (patch) | |
tree | 89973fc4fc77a5c0ac5daa4ea8e0e1afbf23fbf5 /archivers/libarchive/files/libarchive/archive_write_set_format_v7tar.c | |
parent | 3d58b3c8e51f686500fbe08fc5fea947dfa036b4 (diff) | |
download | pkgsrc-85efd7f8759590df15b06d680dc2c141a499d7d3.tar.gz |
Import libarchive 3.4.0KIENTZLE
Diffstat (limited to 'archivers/libarchive/files/libarchive/archive_write_set_format_v7tar.c')
-rw-r--r-- | archivers/libarchive/files/libarchive/archive_write_set_format_v7tar.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/archivers/libarchive/files/libarchive/archive_write_set_format_v7tar.c b/archivers/libarchive/files/libarchive/archive_write_set_format_v7tar.c index 62b15229444..1fdaafd2a93 100644 --- a/archivers/libarchive/files/libarchive/archive_write_set_format_v7tar.c +++ b/archivers/libarchive/files/libarchive/archive_write_set_format_v7tar.c @@ -284,7 +284,7 @@ archive_write_v7tar_header(struct archive_write *a, struct archive_entry *entry) * case getting WCS failed. On POSIX, this is a * normal operation. */ - if (p != NULL && p[strlen(p) - 1] != '/') { + if (p != NULL && p[0] != '\0' && p[strlen(p) - 1] != '/') { struct archive_string as; archive_string_init(&as); @@ -330,14 +330,12 @@ archive_write_v7tar_header(struct archive_write *a, struct archive_entry *entry) #endif ret = format_header_v7tar(a, buff, entry, 1, sconv); if (ret < ARCHIVE_WARN) { - if (entry_main) - archive_entry_free(entry_main); + archive_entry_free(entry_main); return (ret); } ret2 = __archive_write_output(a, buff, 512); if (ret2 < ARCHIVE_WARN) { - if (entry_main) - archive_entry_free(entry_main); + archive_entry_free(entry_main); return (ret2); } if (ret2 < ret) @@ -345,8 +343,7 @@ archive_write_v7tar_header(struct archive_write *a, struct archive_entry *entry) v7tar->entry_bytes_remaining = archive_entry_size(entry); v7tar->entry_padding = 0x1ff & (-(int64_t)v7tar->entry_bytes_remaining); - if (entry_main) - archive_entry_free(entry_main); + archive_entry_free(entry_main); return (ret); } |