Commit 6138956b authored by Andrey Morozov's avatar Andrey Morozov

minor fix

parent 99c2326e
...@@ -46,7 +46,7 @@ namespace cv ...@@ -46,7 +46,7 @@ namespace cv
#else #else
DIR *dp; DIR *dp;
struct dirent *dirp; struct dirent *dirp;
if((dp = opendir(path_f.c_str())) == NULL) if((dp = opendir(path.c_str())) == NULL)
{ {
return list; return list;
} }
...@@ -54,7 +54,13 @@ namespace cv ...@@ -54,7 +54,13 @@ namespace cv
while ((dirp = readdir(dp)) != NULL) while ((dirp = readdir(dp)) != NULL)
{ {
if (dirp->d_type == DT_REG) if (dirp->d_type == DT_REG)
list.push_back(static_cast<std::string>(dirp->d_name)); {
if (exten.compare("*") == 0)
list.push_back(static_cast<std::string>(dirp->d_name));
else
if (std::string(dirp->d_name).find(exten) != std::string::npos)
list.push_back(static_cast<std::string>(dirp->d_name));
}
} }
closedir(dp); closedir(dp);
#endif #endif
...@@ -108,7 +114,11 @@ namespace cv ...@@ -108,7 +114,11 @@ namespace cv
strcmp(dirp->d_name, ".") != 0 && strcmp(dirp->d_name, ".") != 0 &&
strcmp(dirp->d_name, "..") != 0 ) strcmp(dirp->d_name, "..") != 0 )
{ {
list.push_back(static_cast<std::string>(dirp->d_name)); if (exten.compare("*") == 0)
list.push_back(static_cast<std::string>(dirp->d_name));
else
if (std::string(dirp->d_name).find(exten) != std::string::npos)
list.push_back(static_cast<std::string>(dirp->d_name));
} }
} }
closedir(dp); closedir(dp);
......
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