* 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
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)
{
# 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