Attached is a change I made because I was tired of mv copying my
directories when that's not what I desired.  An appropriate Makefile.in
or configure.in change should be made to set ALLOW_COPY_ON_RENAME_FAIL
macro to be set but I'm not interested in that change.

-- 
Earnie.
2001.10.31  Earnie Boyd  <[EMAIL PROTECTED]>

        * src/copy.c (copy_internal): Add CPP filter for 
        ALLOW_COPY_ON_RENAME_FAIL for existing code #else give error and
        return 1.

--- stable/fileutils/4.1/1/src/copy.c   Fri Jun 15 15:20:08 2001
+++ sandbox/fileutils/4.1/2/src/copy.c  Wed Oct 31 16:32:59 2001
@@ -833,7 +833,7 @@ copy_internal (const char *src_path, con
            *rename_succeeded = 1;
          return 0;
        }
-
+#if ALLOW_COPY_ON_RENAME_FAIL
       /* FIXME: someday, consider what to do when moving a directory into
         itself but when source and destination are on different devices.  */
 
@@ -883,6 +883,11 @@ copy_internal (const char *src_path, con
        }
 
       new_dst = 1;
+#else /* ! ALLOW_COPY_ON_RENAME_FAIL */
+      error (0, rename_errno, _("cannot move %s to %s"), quote_n (0, src_path),
+            quote_n (1, dst_path));
+      return 1;
+#endif /* ! ALLOW_COPY_ON_RENAME_FAIL */
     }
 
   delayed_fail = 0;

Reply via email to