diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/copy.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/copy.c b/src/copy.c index fd31b5c91..208a67413 100644 --- a/src/copy.c +++ b/src/copy.c @@ -1339,10 +1339,11 @@ copy_internal (char const *src_name, char const *dst_name, new_dst = true; } else if (! S_ISDIR (dst_sb.st_mode) + /* Never unlink dst_name when in move mode. */ + && ! x->move_mode && (x->unlink_dest_before_opening || (x->preserve_links && 1 < dst_sb.st_nlink) - || (!x->move_mode - && x->dereference == DEREF_NEVER + || (x->dereference == DEREF_NEVER && S_ISLNK (src_sb.st_mode)) )) { |