Paul Eggert <[EMAIL PROTECTED]> wrote: > Peter Breitenlohner <[EMAIL PROTECTED]> writes: > >> I cannot believe that the new behaviour is intentional, and IMHO it doesn't >> make much sense. > > Looking at the patch that changed the behavior: > > http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00285.html > > it appears you're right. That was a fix to mv, but I guess > it inadvertently affected cp. Jim would know more, though.
Thanks for reporting that! Here's a barely-tested patch that restores the desired behavior to cp, while preserving the mv bug fix: This bears some more thought, and test cases [both coming, tomorrow]. Index: src/copy.c =================================================================== RCS file: /fetish/cu/src/copy.c,v retrieving revision 1.213 diff -u -p -r1.213 copy.c --- src/copy.c 24 Sep 2006 19:28:25 -0000 1.213 +++ src/copy.c 12 Oct 2006 22:52:17 -0000 @@ -1181,7 +1181,8 @@ copy_internal (char const *src_name, cha if (x->backup_type != no_backups /* Don't try to back up a destination if the last component of src_name is "." or "..". */ - && ! dot_or_dotdot (last_component (src_name))) + && ! dot_or_dotdot (last_component (src_name)) + && (x->move_mode || ! S_ISDIR (dst_sb.st_mode))) { char *tmp_backup = find_backup_file_name (dst_name, x->backup_type); _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils