summaryrefslogtreecommitdiff
path: root/src/install.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1998-06-01 03:28:16 +0000
committerJim Meyering <jim@meyering.net>1998-06-01 03:28:16 +0000
commitdcfb3e037a2149b067dda19524868d07383e2aa2 (patch)
treea5b3f449de373682eaa68be3cb65fe1e044bb868 /src/install.c
parentbc63f10b59b33af179f3938c29973f542812388a (diff)
downloadcoreutils-dcfb3e037a2149b067dda19524868d07383e2aa2.tar.xz
(main): Fix argv-handling bug in my 1998-05-09 change.
Reported by Don Parsons.
Diffstat (limited to 'src/install.c')
-rw-r--r--src/install.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/install.c b/src/install.c
index f5a3ddbca..78dbad76d 100644
--- a/src/install.c
+++ b/src/install.c
@@ -370,11 +370,18 @@ main (int argc, char **argv)
else
{
int i;
- if (!isdir (file[1]))
- usage (1);
+ const char *dest = file[n_files - 1];
+ if (!isdir (dest))
+ {
+ error (0, 0,
+ _("installing multiple files, but last argument (%s) \
+is not a directory"),
+ dest);
+ usage (1);
+ }
for (i = 0; i < n_files - 1; i++)
{
- errors |= install_file_in_dir (file[i], file[n_files - 1], &x);
+ errors |= install_file_in_dir (file[i], dest, &x);
}
}
}