As reported by Alexey Shuvaev, -dumpl overwrote files after

linking them, with predictably bad results.
This commit is contained in:
Tim Kientzle 2008-06-26 15:46:01 +00:00
parent f4c1db8901
commit 6986afe53e

View File

@ -546,6 +546,8 @@ entry_to_archive(struct cpio *cpio, struct archive_entry *entry)
/* Note: link(2) doesn't create parent directories,
* so we use archive_write_header() instead. */
archive_entry_set_hardlink(t, srcpath);
/* This is a straight link that carries no data. */
archive_entry_set_size(t, 0);
r = archive_write_header(cpio->archive, t);
archive_entry_free(t);
if (r != ARCHIVE_OK)