Explorar o código

Merge pull request #3 from enkiller/master

Filtration . Catalogue and .. Catalogue
geniusgogo %!s(int64=6) %!d(string=hai) anos
pai
achega
8069e2b660
Modificáronse 1 ficheiros con 9 adicións e 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)