mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
(do_copy): Give a better diagnostic when failing due
to nonexistent destination directory. Reported by Dmitry Rutsky. See http://bugs.debian.org/199730 for details.
This commit is contained in:
1 parent
4c8f617f70
commit
89d9530643
1 file changed
+10
-10
@@ -541,18 +541,18 @@ do_copy (int n_files, char **file, const char *target_directory,
|
||||
|
||||
if (!dest_is_dir)
|
||||
{
|
||||
if (target_directory)
|
||||
if (target_directory || 1 < n_files)
|
||||
{
|
||||
error (0, 0, _("%s: specified target is not a directory"),
|
||||
quote (dest));
|
||||
usage (EXIT_FAILURE);
|
||||
}
|
||||
char const *msg;
|
||||
if (new_dst)
|
||||
msg = N_("%s: specified destination directory does not exist");
|
||||
else if (target_directory)
|
||||
msg = N_("%s: specified target is not a directory");
|
||||
else /* n_files > 1 */
|
||||
msg =
|
||||
N_("copying multiple files, but last argument %s is not a directory");
|
||||
|
||||
if (n_files > 1)
|
||||
{
|
||||
error (0, 0,
|
||||
_("copying multiple files, but last argument %s is not a directory"),
|
||||
quote (dest));
|
||||
error (0, 0, _(msg), quote (dest));
|
||||
usage (EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user