From 367719ba5f1dbd5e2f7fa2466c441f23f66a7c9e Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 11 Aug 2004 17:19:25 +0000 Subject: [PATCH] (copy_internal): When preserving links, unlink a destination with link count greater than one. This is so that commands like "cp -a" don't get confused when copying into a destination that already contains many hard links. --- src/copy.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/copy.c b/src/copy.c index 1253035570..61c74c383e 100644 --- a/src/copy.c +++ b/src/copy.c @@ -1079,6 +1079,7 @@ copy_internal (const char *src_path, const char *dst_path, } else if (! S_ISDIR (dst_sb.st_mode) && (x->unlink_dest_before_opening + || (x->preserve_links && 1 < dst_sb.st_nlink) || (x->dereference == DEREF_NEVER && ! S_ISREG (src_sb.st_mode)))) { -- 2.47.2