summaryrefslogtreecommitdiff
path: root/src/copy.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-09-22 14:14:55 +0000
committerJim Meyering <jim@meyering.net>2000-09-22 14:14:55 +0000
commit483f907eb85c54657d86134b3b771aff5bdd7e9b (patch)
tree3caaa4ce9a1bd8f40e41599f070f071b30305226 /src/copy.c
parentf680954f1f306c0a8dcde5518238446beea5c34a (diff)
downloadcoreutils-483f907eb85c54657d86134b3b771aff5bdd7e9b.tar.xz
(copy_internal): Don't try to unlink directories when
using --remove-dest with -R.
Diffstat (limited to 'src/copy.c')
-rw-r--r--src/copy.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/copy.c b/src/copy.c
index 74bafd635..75046b4d7 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -723,10 +723,10 @@ copy_internal (const char *src_path, const char *dst_path,
}
new_dst = 1;
}
- else if (x->unlink_dest_before_opening
- || (x->xstat == lstat
- && ! S_ISREG (src_sb.st_mode)
- && ! S_ISDIR (src_sb.st_mode)))
+ else if (! S_ISDIR (dst_sb.st_mode)
+ && (x->unlink_dest_before_opening
+ || (x->xstat == lstat
+ && ! S_ISREG (src_sb.st_mode))))
{
if (unlink (dst_path) && errno != ENOENT)
{