don't compute isdir() of -- or an option string

This commit is contained in:
Jim Meyering committed 1999-10-17 07:39:20 +00:00
1 parent b221905959
commit a374a307c5
1 file changed
+7 -3
+7 -3
View File
@@ -438,10 +438,14 @@ main (int argc, char **argv)
file = argv + optind;
target_directory_specified = (target_directory != NULL);
if (!target_directory)
target_directory = file[n_files - 1];
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];
}
dest_is_dir = isdir (target_directory);
dest_is_dir = (n_files > 0 && isdir (target_directory));
if (target_directory_specified)
{