Explorar el Código

Merge pull request #3 from enkiller/master

Filtration . Catalogue and .. Catalogue
geniusgogo hace 6 años
padre
commit
8069e2b660
Se han modificado 1 ficheros con 9 adiciones y 0 borrados
  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)