]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(copy_internal): Don't try to unlink directories when
authorJim Meyering <jim@meyering.net>
Fri, 22 Sep 2000 14:14:55 +0000 (14:14 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 22 Sep 2000 14:14:55 +0000 (14:14 +0000)
using --remove-dest with -R.

src/copy.c

index 74bafd6357228796f9dc1810aed5e35f232e19c8..75046b4d7bda05c3778921deb223adebe350e7f5 100644 (file)
@@ -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)
                {