diff options
author | Jim Meyering <jim@meyering.net> | 2000-09-22 20:41:40 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2000-09-22 20:41:40 +0000 |
commit | a04e5b9dbc6e233a2cbc79ab81b1c22d9438927e (patch) | |
tree | 6743f7f327415cf9e30d988e0d54f2ec4e225551 | |
parent | ce8d840e83648f6797afd22500cb927e8a09e97f (diff) | |
download | coreutils-a04e5b9dbc6e233a2cbc79ab81b1c22d9438927e.tar.xz |
(main): When used with --force, each of the --link and
--symbolic-link options now implies --remove-destination.
-rw-r--r-- | src/cp.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -882,6 +882,11 @@ Use `--parents' for the old meaning, and `--no-dereference' for the new.")); x.xstat = stat; } + /* If --force (-f) was specified and we're in link-creation mode, + first remove any existing destination file. */ + if (x.unlink_dest_after_failed_open && (x.hard_link || x.symbolic_link)) + x.unlink_dest_before_opening = 1; + /* Allocate space for remembering copied and created files. */ hash_init (INITIAL_HASH_MODULE, INITIAL_ENTRY_TAB_SIZE); |