If skip_file_dev and skip_file_ino haven't been set (are still == 0),

then don't use them for testing for a recursive add.

Thanks to: Spencer Minear
MFC after: 7 days
This commit is contained in:
Tim Kientzle 2006-08-01 05:31:29 +00:00
parent a4755e0e13
commit 225ade520e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=160870

View File

@ -201,7 +201,9 @@ archive_write_header(struct archive *a, struct archive_entry *entry)
if (a->state & ARCHIVE_STATE_DATA)
((a->format_finish_entry)(a));
if (archive_entry_dev(entry) == a->skip_file_dev &&
if (a->skip_file_dev != 0 &&
archive_entry_dev(entry) == a->skip_file_dev &&
a->skip_file_ino != 0 &&
archive_entry_ino(entry) == a->skip_file_ino) {
archive_set_error(a, 0, "Can't add archive to itself");
return (ARCHIVE_WARN);