From 0e35a97bf93d249479007c0f7cc4d8dfae113871 Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Sun, 8 May 2005 19:10:41 +0000 Subject: [PATCH] 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 --- lib/libarchive/archive_entry.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/libarchive/archive_entry.c b/lib/libarchive/archive_entry.c index f0f0042f4e87..b4b743530fb4 100644 --- a/lib/libarchive/archive_entry.c +++ b/lib/libarchive/archive_entry.c @@ -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