diff options
author | kientzle <kientzle@FreeBSD.org> | 2004-11-15 01:46:33 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2004-11-15 01:46:33 +0000 |
commit | 35042e9828a7a43c514159b632c123ab2c97b4b9 (patch) | |
tree | ecaf28bbb750e0f4390f29437ec0e99aa31b8dcb /lib/libarchive | |
parent | 70764b092dbdd3b3807974ce1761d50773530da8 (diff) | |
download | FreeBSD-src-35042e9828a7a43c514159b632c123ab2c97b4b9.zip FreeBSD-src-35042e9828a7a43c514159b632c123ab2c97b4b9.tar.gz |
Since I'm not using the public API for writing
the the pax attributes, I shouldn't try using the public
API for finishing out the attribute entry, either.
This also removes some old dubious state manipulations.
Diffstat (limited to 'lib/libarchive')
-rw-r--r-- | lib/libarchive/archive_write_set_format_pax.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/libarchive/archive_write_set_format_pax.c b/lib/libarchive/archive_write_set_format_pax.c index 94f3e65..465d65f 100644 --- a/lib/libarchive/archive_write_set_format_pax.c +++ b/lib/libarchive/archive_write_set_format_pax.c @@ -315,7 +315,7 @@ archive_write_pax_header(struct archive *a, const char *linkname, *p; const char *hardlink; const wchar_t *wp, *wp2, *wname_start; - int need_extension, oldstate, r, ret; + int need_extension, r, ret; struct pax *pax; const struct stat *st_main, *st_original; @@ -672,17 +672,19 @@ archive_write_pax_header(struct archive *a, pax->entry_bytes_remaining = archive_strlen(&(pax->pax_header)); pax->entry_padding = 0x1ff & (- pax->entry_bytes_remaining); - oldstate = a->state; - a->state = ARCHIVE_STATE_DATA; r = (a->compression_write)(a, pax->pax_header.s, archive_strlen(&(pax->pax_header))); - a->state = oldstate; if (r != ARCHIVE_OK) { /* If a write fails, we're pretty much toast. */ return (ARCHIVE_FATAL); } - - archive_write_pax_finish_entry(a); + /* Pad out the end of the entry. */ + r = write_nulls(a, pax->entry_padding); + if (r != ARCHIVE_OK) { + /* If a write fails, we're pretty much toast. */ + return (ARCHIVE_FATAL); + } + pax->entry_bytes_remaining = pax->entry_padding = 0; } /* Write the header for main entry. */ |