minor fix
This commit is contained in:
parent
8a06b20ad6
commit
99c2326e51
@ -46,7 +46,7 @@ namespace cv
|
|||||||
#else
|
#else
|
||||||
DIR *dp;
|
DIR *dp;
|
||||||
struct dirent *dirp;
|
struct dirent *dirp;
|
||||||
if((dp = opendir(path.c_str())) == NULL)
|
if((dp = opendir(path_f.c_str())) == NULL)
|
||||||
{
|
{
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
@ -54,7 +54,7 @@ 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<string>(dirp->d_name));
|
list.push_back(static_cast<std::string>(dirp->d_name));
|
||||||
}
|
}
|
||||||
closedir(dp);
|
closedir(dp);
|
||||||
#endif
|
#endif
|
||||||
@ -97,15 +97,19 @@ namespace cv
|
|||||||
#else
|
#else
|
||||||
DIR *dp;
|
DIR *dp;
|
||||||
struct dirent *dirp;
|
struct dirent *dirp;
|
||||||
if((dp = opendir(path.c_str())) == NULL)
|
if((dp = opendir(path_f.c_str())) == NULL)
|
||||||
{
|
{
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((dirp = readdir(dp)) != NULL)
|
while ((dirp = readdir(dp)) != NULL)
|
||||||
{
|
{
|
||||||
if (dirp->d_type == DT_DIR)
|
if (dirp->d_type == DT_DIR &&
|
||||||
list.push_back(static_cast<string>(dirp->d_name));
|
strcmp(dirp->d_name, ".") != 0 &&
|
||||||
|
strcmp(dirp->d_name, "..") != 0 )
|
||||||
|
{
|
||||||
|
list.push_back(static_cast<std::string>(dirp->d_name));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
closedir(dp);
|
closedir(dp);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user