Browse Source

Filtration . Catalogue and .. Catalogue

tangyuxin 6 năm trước cách đây
mục cha
commit
e0fdfcdda4
1 tập tin đã thay đổi với 9 bổ sung0 xóa
  1. 9 0
      dfs_lfs.c

+ 9 - 0
dfs_lfs.c

@@ -778,6 +778,15 @@ static int _dfs_lfs_getdents(struct dfs_fd* file, struct dirent* dirp, uint32_t
             break;
         }
 
+        if (rt_strcmp(info.name, ".") == 0)
+        {
+            continue;
+        }
+        else if (rt_strcmp(info.name, "..") == 0)
+        {
+            continue;
+        }
+
         d->d_type = DT_UNKNOWN;
 
         switch (info.type)