Jose Miguel Goncalves <[email protected]> ha escrit:

> I'm facing the same problem reported back in March, 17 by Wouter
> Verhelst, regarding storing hard links in tar using --transform.
> I'm using tar 1.22.

I must have overlooked the original report. Please, try the attached
patch. Let me know if it works for you.

Regards,
Sergey

diff --git a/src/create.c b/src/create.c
index a925160..56ea588 100644
--- a/src/create.c
+++ b/src/create.c
@@ -1428,11 +1428,11 @@ file_count_links (struct tar_stat_info *st)
     {
       struct link *duplicate;
       struct link *lp = xmalloc (offsetof (struct link, name)
-				 + strlen (st->orig_file_name) + 1);
+				 + strlen (st->file_name) + 1);
       lp->ino = st->stat.st_ino;
       lp->dev = st->stat.st_dev;
       lp->nlink = st->stat.st_nlink;
-      strcpy (lp->name, st->orig_file_name);
+      strcpy (lp->name, st->file_name);
 
       if (! ((link_table
 	      || (link_table = hash_initialize (0, 0, hash_link,

Reply via email to