diff --git a/cli/filelister.cpp b/cli/filelister.cpp index e7e6677d7..f80ce060c 100644 --- a/cli/filelister.cpp +++ b/cli/filelister.cpp @@ -202,7 +202,12 @@ static void addFiles2(std::map &files, new_path = path + '/' + dir_result->d_name; - if (dir_result->d_type == DT_DIR || (dir_result->d_type == DT_UNKNOWN && FileLister::isDirectory(new_path))) { +#if defined(_DIRENT_HAVE_D_TYPE) || defined(_BSD_SOURCE) + bool path_is_directory = (dir_result->d_type == DT_DIR || (dir_result->d_type == DT_UNKNOWN && FileLister::isDirectory(new_path))); +#else + bool path_is_directory = FileLister::isDirectory(new_path); +#endif + if (path_is_directory) { if (recursive && !ignored.match(new_path)) { addFiles2(files, new_path, extra, recursive, ignored); }