diff options
author | Jim Meyering <jim@meyering.net> | 1998-06-01 03:28:16 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1998-06-01 03:28:16 +0000 |
commit | dcfb3e037a2149b067dda19524868d07383e2aa2 (patch) | |
tree | a5b3f449de373682eaa68be3cb65fe1e044bb868 /src | |
parent | bc63f10b59b33af179f3938c29973f542812388a (diff) | |
download | coreutils-dcfb3e037a2149b067dda19524868d07383e2aa2.tar.xz |
(main): Fix argv-handling bug in my 1998-05-09 change.
Reported by Don Parsons.
Diffstat (limited to 'src')
-rw-r--r-- | src/install.c | 13 |
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); } } } |