]> git.ipfire.org Git - thirdparty/coreutils.git/commit
copy: go back to failing 'cp --backup a~ a'
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 1 Aug 2017 20:14:03 +0000 (13:14 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 1 Aug 2017 20:18:45 +0000 (13:18 -0700)
commita04039284cca9dcbc6b71b1058e63d35925ce164
treed166569f06889cf5a31d8a2f3a6be46577825866
parente01bb64aeb0409d4ef6264cfdac5e1a248dd980d
copy: go back to failing 'cp --backup a~ a'

Suggested by Kamil Dudka in:
http://lists.gnu.org/archive/html/coreutils/2017-07/msg00072.html
* NEWS: Document the changed nature of the fix.
* doc/coreutils.texi, tests/cp/backup-is-src.sh:
* tests/mv/backup-is-src.sh: Revert previous change.
* src/copy.c (source_is_dst_backup): New function.
(copy_internal): Use it.  Fail instead of falling back on numbered
backups when it looks like the backup will overwrite the source.
Although this reintroduces a race, it's more compatible with
previous behavior.
NEWS
doc/coreutils.texi
src/copy.c
tests/cp/backup-is-src.sh
tests/mv/backup-is-src.sh