This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new baa4da2  Revert "arch/sim/src/sim/up_hostfs.c:   hostfs skip '.' and 
'..' in readdir'"
baa4da2 is described below

commit baa4da2d0f38bdd77af63db2598789ced4641458
Author: Xiang Xiao <xiaoxi...@xiaomi.com>
AuthorDate: Mon Aug 10 02:44:04 2020 +0800

    Revert "arch/sim/src/sim/up_hostfs.c:   hostfs skip '.' and '..' in 
readdir'"
    
    This reverts commit 9f0502f8baad9e7717f11a66849727cf05010806.
---
 arch/sim/src/sim/up_hostfs.c | 21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/arch/sim/src/sim/up_hostfs.c b/arch/sim/src/sim/up_hostfs.c
index f6f55fd..2c6e251 100644
--- a/arch/sim/src/sim/up_hostfs.c
+++ b/arch/sim/src/sim/up_hostfs.c
@@ -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)
-        {
-          break;
-        }
-
-      /* Skip '.' and '..' */
-
-      if (ent->d_name[0] == '.' && (ent->d_name[1] == '\0' ||
-          (ent->d_name[1] == '.' && ent->d_name[2] == '\0')))
-        {
-          continue;
-        }
+  /* Call the host's readdir routine */
 
+  ent = readdir(dirp);
+  if (ent != NULL)
+    {
       /* Copy the entry name */
 
       strncpy(entry->d_name, ent->d_name, sizeof(entry->d_name) - 1);

Reply via email to