From: Jim Meyering Date: Fri, 22 Sep 2000 14:14:55 +0000 (+0000) Subject: (copy_internal): Don't try to unlink directories when X-Git-Tag: FILEUTILS-4_0_27~23 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=483f907eb85c54657d86134b3b771aff5bdd7e9b;p=thirdparty%2Fcoreutils.git (copy_internal): Don't try to unlink directories when using --remove-dest with -R. --- diff --git a/src/copy.c b/src/copy.c index 74bafd6357..75046b4d7b 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) {