(main): Fix target_directory parsing when n_files == 1.
authorJim Meyering <jim@meyering.net>
Tue, 8 Oct 2002 14:25:49 +0000 (14:25 +0000)
committerJim Meyering <jim@meyering.net>
Tue, 8 Oct 2002 14:25:49 +0000 (14:25 +0000)
Patch by Dmitry V. Levin.

src/ln.c

index a674ad2..0bbd2cb 100644 (file)
--- a/src/ln.c
+++ b/src/ln.c
@@ -495,9 +495,9 @@ main (int argc, char **argv)
   if (!target_directory)
     target_directory = file[n_files - 1];
 
-  /* If there's only one file argument, then pretend `.' was given
-     as the second argument.  */
-  if (n_files == 1)
+  /* If target directory is not specified, and there's only one
+     file argument, then pretend `.' was given as the second argument.  */
+  if (!target_directory_specified && n_files == 1)
     {
       static char *dummy[2];
       dummy[0] = file[0];