diff --git a/src/main.cpp b/src/main.cpp index 86dea53ab382611e08479784d6cb48635c5513dc..0a4b544f1c09ba071e9b83dbd5f339028c4b3316 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -84,13 +84,13 @@ int print_dir_recursive(char *arguments[], bool recursive) for (std::filesystem::recursive_directory_iterator i(path), end; i != end; ++i) if (is_directory(i->path())) std::cout << i->path().generic_string() << "/\n"; - else + else if (is_regular_file(i->path())) std::cout << i->path().generic_string() << "\n"; } else { for (std::filesystem::directory_iterator i(path), end; i != end; ++i) if (is_directory(i->path())) std::cout << i->path().generic_string() << "/\n"; - else + else if (is_regular_file(i->path())) std::cout << i->path().generic_string() << "\n"; }