From: Jim Meyering Date: Mon, 1 Jun 1998 03:28:16 +0000 (+0000) Subject: (main): Fix argv-handling bug in my 1998-05-09 change. X-Git-Tag: FILEUTILS-3_16p~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dcfb3e037a2149b067dda19524868d07383e2aa2;p=thirdparty%2Fcoreutils.git (main): Fix argv-handling bug in my 1998-05-09 change. Reported by Don Parsons. --- diff --git a/src/install.c b/src/install.c index f5a3ddbca5..78dbad76db 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); } } }