Skip to content

Commit aac8a0a

Browse files
committed
Reset directory iteration in remove_dir_all
1 parent 9fa62f2 commit aac8a0a

File tree

1 file changed

+3
-1
lines changed
  • library/std/src/sys/windows

1 file changed

+3
-1
lines changed

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -1035,11 +1035,13 @@ fn remove_dir_all_iterative(f: &File, delete: fn(&File) -> io::Result<()>) -> io
10351035
unsafe { mem::ManuallyDrop::new(File::from_raw_handle(f.as_raw_handle())) }
10361036
}
10371037

1038+
let mut restart = true;
10381039
while let Some(dir) = dirlist.last() {
10391040
let dir = copy_handle(dir);
10401041

10411042
// Fill the buffer and iterate the entries.
1042-
let more_data = dir.fill_dir_buff(&mut buffer, false)?;
1043+
let more_data = dir.fill_dir_buff(&mut buffer, restart)?;
1044+
restart = false;
10431045
for (name, is_directory) in buffer.iter() {
10441046
if is_directory {
10451047
let child_dir = open_link_no_reparse(

0 commit comments

Comments
 (0)