Commit deb7f4d4 authored by Andrey Kamaev's avatar Andrey Kamaev

Fix globbing failure when stat call fails

parent 78a843e8
......@@ -111,11 +111,11 @@ static bool isDir(const cv::String& path, DIR* dir)
return (attributes != INVALID_FILE_ATTRIBUTES) && ((attributes & FILE_ATTRIBUTE_DIRECTORY) != 0);
#else
(void)dir;
struct stat stat_buf;
stat( path.c_str(), &stat_buf);
if (0 != stat( path.c_str(), &stat_buf))
return false;
int is_dir = S_ISDIR( stat_buf.st_mode);
(void)dir;
return is_dir != 0;
#endif
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment