summaryrefslogtreecommitdiff
path: root/src/ln.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-10-08 14:25:49 +0000
committerJim Meyering <jim@meyering.net>2002-10-08 14:25:49 +0000
commit1d2876761d4de6176aba4e9371dc438a436a1b1f (patch)
tree23d6b2ff3e7bbd44dab50a00e482dd8f559b7bc6 /src/ln.c
parenta890541a5d67d395e9f36aaaf5284457a03611f6 (diff)
downloadcoreutils-1d2876761d4de6176aba4e9371dc438a436a1b1f.tar.gz
(main): Fix target_directory parsing when n_files == 1.
Patch by Dmitry V. Levin.
Diffstat (limited to 'src/ln.c')
-rw-r--r--src/ln.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ln.c b/src/ln.c
index a674ad25a..0bbd2cb6e 100644
--- 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];