From c924e93ad90dc556113d8a8e0b8367af3d0d803b Mon Sep 17 00:00:00 2001 From: pjht Date: Wed, 20 Nov 2024 13:05:22 -0600 Subject: [PATCH] mikros: Skip . and .. in ReadDir --- library/std/src/sys/pal/mikros/fs.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/std/src/sys/pal/mikros/fs.rs b/library/std/src/sys/pal/mikros/fs.rs index 1a83bc0575c..8c12728507e 100644 --- a/library/std/src/sys/pal/mikros/fs.rs +++ b/library/std/src/sys/pal/mikros/fs.rs @@ -289,6 +289,9 @@ fn next(&mut self) -> Option> { Ok(val) => val, Err(e) => return Some(Err(e.into())), }; + if entry_name == ".." || entry_name == "." { + return self.next(); + } let mut entry_path = self.path.clone(); entry_path.push(entry_name); Some(Ok(DirEntry { path: entry_path }))