Fix the effect of --transform over hard link targets without the --absolute-names

* src/create.c (file_count_links): Apply safer_name_suffix to the
hard link name prior to transforming it.
* tests/xform03.at: New test case.
* tests/Makefile.am: Add xform03.at
* tests/testsuite.at: Likewise.
This commit is contained in:
Sergey Poznyakoff
2017-09-30 10:04:02 +03:00
parent 228d83ed24
commit 1e6d2c0488
4 changed files with 45 additions and 1 deletions

View File

@@ -1534,7 +1534,8 @@ file_count_links (struct tar_stat_info *st)
char *linkname = NULL;
struct link *lp;
assign_string (&linkname, st->orig_file_name);
assign_string (&linkname, safer_name_suffix (st->orig_file_name, true,
absolute_names_option));
transform_name (&linkname, XFORM_LINK);
lp = xmalloc (offsetof (struct link, name)