SunOs 11 compatibility with dirent (#1574)

* SunOs 11 compatibility issue solved. Member d_type is a BSD extension

* Added test for BSD also.

* Extra empty lines removed
This commit is contained in:
vahtis 2019-01-08 22:17:04 +02:00 committed by Daniel Marjamäki
parent 97bf5de133
commit 5fc7fadf84
1 changed files with 6 additions and 1 deletions

View File

@ -202,7 +202,12 @@ static void addFiles2(std::map<std::string, std::size_t> &files,
new_path = path + '/' + dir_result->d_name; 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)) { if (recursive && !ignored.match(new_path)) {
addFiles2(files, new_path, extra, recursive, ignored); addFiles2(files, new_path, extra, recursive, ignored);
} }