archive_entry_set_link is supposed to update whichever link field

(symlink or hardlink) is already set.  Instead, it was always setting
the hardlink field.  In particular, this caused GNU tar format long
symlinks to be interpreted as hardlinks.

Thanks to: Brooks Davis
MFC after: 7 days
This commit is contained in:
Tim Kientzle 2005-05-08 19:10:41 +00:00
parent 769f92857b
commit 0e35a97bf9

View File

@ -575,7 +575,8 @@ archive_entry_set_link(struct archive_entry *entry, const char *target)
if (entry->ae_symlink.aes_mbs != NULL ||
entry->ae_symlink.aes_wcs != NULL)
aes_set_mbs(&entry->ae_symlink, target);
aes_set_mbs(&entry->ae_hardlink, target);
else
aes_set_mbs(&entry->ae_hardlink, target);
}
void