Revert "arch/sim/src/sim/up_hostfs.c: hostfs skip '.' and '..' in readdir'"

This reverts commit 9f0502f8ba.
This commit is contained in:
Xiang Xiao 2020-08-10 02:44:04 +08:00 committed by patacongo
parent 662e6789ea
commit baa4da2d0f
1 changed files with 4 additions and 17 deletions

View File

@ -364,24 +364,11 @@ int host_readdir(void *dirp, struct nuttx_dirent_s *entry)
{
struct dirent *ent;
for (; ; )
/* Call the host's readdir routine */
ent = readdir(dirp);
if (ent != NULL)
{
/* Call the host's readdir routine */
ent = readdir(dirp);
if (ent == NULL)
{
break;
}
/* Skip '.' and '..' */
if (ent->d_name[0] == '.' && (ent->d_name[1] == '\0' ||
(ent->d_name[1] == '.' && ent->d_name[2] == '\0')))
{
continue;
}
/* Copy the entry name */
strncpy(entry->d_name, ent->d_name, sizeof(entry->d_name) - 1);