Procházet zdrojové kódy

Merge pull request #3 from enkiller/master

Filtration . Catalogue and .. Catalogue
geniusgogo před 6 roky
rodič
revize
8069e2b660
1 změnil soubory, kde provedl 9 přidání a 0 odebrání
  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)