summaryrefslogtreecommitdiff
path: root/src/ln.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ln.c')
-rw-r--r--src/ln.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ln.c b/src/ln.c
index ef10cac36..ea1d38358 100644
--- a/src/ln.c
+++ b/src/ln.c
@@ -482,15 +482,15 @@ main (int argc, char **argv)
}
}
- n_files = argc - optind;
- file = argv + optind;
-
- if (n_files == 0)
+ if (argc <= optind)
{
error (0, 0, _("missing file argument"));
usage (EXIT_FAILURE);
}
+ n_files = argc - optind;
+ file = argv + optind;
+
target_directory_specified = (target_directory != NULL);
if (!target_directory)
target_directory = file[n_files - 1];