Import libarchive-2.4.8:
authorPeter Avalos <pavalos@dragonflybsd.org>
Sat, 22 Dec 2007 21:53:04 +0000 (21:53 +0000)
committerPeter Avalos <pavalos@dragonflybsd.org>
Sat, 22 Dec 2007 21:53:04 +0000 (21:53 +0000)
gzip and bzip2 compression now handle zero-byte writes correctly.

Fix a couple of minor memory leaks.

contrib/libarchive-2/NEWS
contrib/libarchive-2/libarchive/archive_read_support_format_cpio.c
contrib/libarchive-2/libarchive/archive_read_support_format_tar.c
contrib/libarchive-2/libarchive/archive_write_set_compression_bzip2.c
contrib/libarchive-2/libarchive/archive_write_set_compression_gzip.c
contrib/libarchive-2/version

index 89f907d..fb0e9e5 100644 (file)
@@ -1,4 +1,14 @@
 
+Dec 13, 2007: libarchive 2.4.8 released
+Dec 13, 2007: gzip and bzip2 compression now handle zero-byte writes correctly,
+       Thanks to Damien Golding for bringing this to my attention.
+
+Dec 12, 2007: libarchive 2.4.7 released
+
+Dec 10, 2007: libarchive 2.4.6 released
+Dec 09, 2007: tar/test/test_copy.c verifies "tar -c | tar -x" copy pipeline
+Dec 07, 2007: Fix a couple of minor memory leaks.
+
 Dec 04, 2007: libarchive 2.4.5 released
 Dec 04, 2007: Fix cpio/test/test_write_odc by setting the umask first.
 
@@ -10,7 +20,7 @@ Dec 03, 2007: libarchive 2.4.3 released
 Dec 03, 2007: Thanks to Lapo Luchini for sending me a ZIP file that
        libarchive couldn't handle.  Fixed a bug in handling of
        "length at end" flags in ZIP files.
-Dec 03, 2007: Fixed bsdcpio/bsdtar -help tests.
+Dec 03, 2007: Fixed bsdcpio -help, bsdtar -help tests.
 Dec 02, 2007: First cut at real bsdtar test harness.
 
 Dec 02, 2007: libarchive 2.4.2 released
index 1ede8b6..8c531fa 100644 (file)
@@ -741,7 +741,7 @@ record_hardlink(struct cpio *cpio, struct archive_entry *entry)
          */
         for (le = cpio->links_head; le; le = le->next) {
                 if (le->dev == dev && le->ino == ino) {
-                        archive_entry_set_hardlink(entry, le->name);
+                        archive_entry_copy_hardlink(entry, le->name);
 
                         if (--le->links <= 0) {
                                 if (le->previous != NULL)
@@ -750,6 +750,7 @@ record_hardlink(struct cpio *cpio, struct archive_entry *entry)
                                         le->next->previous = le->previous;
                                 if (cpio->links_head == le)
                                         cpio->links_head = le->next;
+                               free(le->name);
                                 free(le);
                         }
 
index 6d6ee30..7d57425 100644 (file)
@@ -278,6 +278,8 @@ archive_read_format_tar_cleanup(struct archive_read *a)
        archive_string_free(&tar->line);
        archive_string_free(&tar->pax_global);
        archive_string_free(&tar->pax_header);
+       archive_string_free(&tar->longname);
+       archive_string_free(&tar->longlink);
        free(tar->pax_entry);
        free(tar);
        (a->format->data) = NULL;
index 0883ea1..b32167c 100644 (file)
@@ -320,6 +320,10 @@ drive_compressor(struct archive_write *a, struct private_data *state, int finish
                        state->stream.avail_out = bytes_written;
                }
 
+               /* If there's nothing to do, we're done. */
+               if (!finishing && state->stream.avail_in == 0)
+                       return (ARCHIVE_OK);
+
                ret = BZ2_bzCompress(&(state->stream),
                    finishing ? BZ_FINISH : BZ_RUN);
 
@@ -339,7 +343,9 @@ drive_compressor(struct archive_write *a, struct private_data *state, int finish
                        /* Any other return value indicates an error */
                        archive_set_error(&a->archive,
                            ARCHIVE_ERRNO_PROGRAMMER,
-                           "Bzip2 compression failed");
+                           "Bzip2 compression failed;"
+                           " BZ2_bzCompress() returned %d",
+                           ret);
                        return (ARCHIVE_FATAL);
                }
        }
index 56a0a11..f43fa80 100644 (file)
@@ -378,6 +378,10 @@ drive_compressor(struct archive_write *a, struct private_data *state, int finish
                        state->stream.avail_out = bytes_written;
                }
 
+               /* If there's nothing to do, we're done. */
+               if (!finishing && state->stream.avail_in == 0)
+                       return (ARCHIVE_OK);
+
                ret = deflate(&(state->stream),
                    finishing ? Z_FINISH : Z_NO_FLUSH );
 
@@ -396,7 +400,9 @@ drive_compressor(struct archive_write *a, struct private_data *state, int finish
                default:
                        /* Any other return value indicates an error. */
                        archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
-                           "GZip compression failed");
+                           "GZip compression failed:"
+                           " deflate() call returned status %d",
+                           ret);
                        return (ARCHIVE_FATAL);
                }
        }
index 26f8b8b..752a79e 100644 (file)
@@ -1 +1 @@
-2.4.5
\ No newline at end of file
+2.4.8
\ No newline at end of file