Skip to content

Commit 595e88a

Browse files
committed
Windows: make read_dir stop iterating on error
1 parent 015c777 commit 595e88a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/std/src/sys/fs/windows.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ impl Iterator for ReadDir {
132132
let mut wfd = mem::zeroed();
133133
loop {
134134
if c::FindNextFileW(handle.0, &mut wfd) == 0 {
135+
self.handle = None;
135136
match api::get_last_error() {
136137
WinError::NO_MORE_FILES => return None,
137138
WinError { code } => {

0 commit comments

Comments
 (0)