diff options
author | Pádraig Brady <P@draigBrady.com> | 2010-12-18 02:50:33 +0000 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2010-12-19 00:36:29 +0000 |
commit | e66948c3b59045bf8b9f6bd1e0dcc3bb93488cab (patch) | |
tree | 77ff3c316573b8dc186020f232f31c3b859a0721 /src | |
parent | 0e181024c00b746a930aab6a0cfd9162d7b67ae4 (diff) | |
download | coreutils-e66948c3b59045bf8b9f6bd1e0dcc3bb93488cab.tar.xz |
cp: ensure backups are created when -T specified
* src/cp.c (do_copy): When -T is specified, initialize
the NEW_DST and SB variables, which are checked when
running: cp -T --force --backup file file
* tests/cp/backup-1: Add the -T case
Diffstat (limited to 'src')
-rw-r--r-- | src/cp.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -604,6 +604,8 @@ do_copy (int n_files, char **file, const char *target_directory, error (0, 0, _("extra operand %s"), quote (file[2])); usage (EXIT_FAILURE); } + /* Update NEW_DST and SB, which may be checked below. */ + ignore_value (target_directory_operand (file[n_files -1], &sb, &new_dst)); } else if (!target_directory) { |