summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/copy.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/copy.c b/src/copy.c
index e1cd5fa21..1a265e3c2 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -371,8 +371,9 @@ copy_reg (char const *src_name, char const *dst_name,
the above open fails with EEXIST. If that happens, and
lstat'ing the DST_NAME shows that it is a symlink, repeat
the open call, but this time with the name of the final,
- missing directory entry. */
- if (dest_desc < 0 && dest_errno == EEXIST)
+ missing directory entry. All of this is relevant only for
+ cp, i.e., not in move_mode. */
+ if (dest_desc < 0 && dest_errno == EEXIST && ! x->move_mode)
{
struct stat dangling_link_sb;
if (lstat (dst_name, &dangling_link_sb) == 0