summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mv.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/mv.c b/src/mv.c
index 3e1e6b96c..71b4de856 100644
--- a/src/mv.c
+++ b/src/mv.c
@@ -464,12 +464,8 @@ main (int argc, char **argv)
file = argv + optind;
target_directory_specified = (target_directory != NULL);
- if (target_directory == NULL)
- {
- /* Be careful below. When n_files is 0, this value will be
- argv[0], `--', or an option string. */
- target_directory = file[n_files - 1];
- }
+ if (target_directory == NULL && n_files != 0)
+ target_directory = file[n_files - 1];
dest_is_dir = (n_files > 0 && isdir (target_directory));