Fix hard links recognition with -c --remove-files
* src/create.c (dump_hard_link): Always look up in the link table if remove_files_option is set. Patch suggested by Theodore Ts'o <tytso@mit.edu>. (check_links): Remove extra newline from the warning message. * tests/link02.at, tests/link03.at: New testcases. * tests/Makefile.am (TESTSUITE_AT): Add link02.at and link03.at * tests/testsuite.at: Include link02.at and link03.at
This commit is contained in:
@@ -1377,7 +1377,7 @@ static Hash_table *link_table;
|
||||
static bool
|
||||
dump_hard_link (struct tar_stat_info *st)
|
||||
{
|
||||
if (link_table && st->stat.st_nlink > 1)
|
||||
if (link_table && (st->stat.st_nlink > 1 || remove_files_option))
|
||||
{
|
||||
struct link lp;
|
||||
struct link *duplicate;
|
||||
@@ -1468,7 +1468,7 @@ check_links (void)
|
||||
{
|
||||
if (lp->nlink)
|
||||
{
|
||||
WARN ((0, 0, _("Missing links to %s.\n"), quote (lp->name)));
|
||||
WARN ((0, 0, _("Missing links to %s."), quote (lp->name)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user