mikros: Skip . and .. in ReadDir

This commit is contained in:
pjht 2024-11-20 13:05:22 -06:00
parent 9053e03f10
commit c924e93ad9
Signed by: pjht
GPG Key ID: CA239FC6934E6F3A

View File

@ -289,6 +289,9 @@ fn next(&mut self) -> Option<io::Result<DirEntry>> {
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 }))