mikros: Skip . and .. in ReadDir
This commit is contained in:
parent
9053e03f10
commit
c924e93ad9
@ -289,6 +289,9 @@ fn next(&mut self) -> Option<io::Result<DirEntry>> {
|
|||||||
Ok(val) => val,
|
Ok(val) => val,
|
||||||
Err(e) => return Some(Err(e.into())),
|
Err(e) => return Some(Err(e.into())),
|
||||||
};
|
};
|
||||||
|
if entry_name == ".." || entry_name == "." {
|
||||||
|
return self.next();
|
||||||
|
}
|
||||||
let mut entry_path = self.path.clone();
|
let mut entry_path = self.path.clone();
|
||||||
entry_path.push(entry_name);
|
entry_path.push(entry_name);
|
||||||
Some(Ok(DirEntry { path: entry_path }))
|
Some(Ok(DirEntry { path: entry_path }))
|
||||||
|
Loading…
Reference in New Issue
Block a user