diff options
-rw-r--r-- | src/cp.c | 2 | ||||
-rwxr-xr-x | tests/cp/backup-1 | 4 |
2 files changed, 4 insertions, 2 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) { diff --git a/tests/cp/backup-1 b/tests/cp/backup-1 index 94c1f2a67..fb1c00b7b 100755 --- a/tests/cp/backup-1 +++ b/tests/cp/backup-1 @@ -30,8 +30,8 @@ echo test > $file || fail=1 # Specify both version control and suffix so the environment variables # (possibly set by the user running these tests) aren't used. -cp --force --backup=simple --suffix=$suffix $file $file \ - || fail=1 +cp --force --backup=simple --suffix=$suffix $file $file || fail=1 +cp -T --force --backup=simple --suffix=$suffix $file $file || fail=1 test -f $file || fail=1 test -f $file_backup || fail=1 |