Skip to content

Commit dcf53c1

Browse files
committed
Rewrite remove_dir_all to be correct
The fact that this had to be rewritten does not bode well
1 parent b1b9edf commit dcf53c1

File tree

1 file changed

+5
-3
lines changed
  • src/libstd/sys/windows

1 file changed

+5
-3
lines changed

src/libstd/sys/windows/fs.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -611,9 +611,11 @@ fn remove_dir_all_recursive(path: &Path) -> io::Result<()> {
611611
let child = child?;
612612
let child_type = child.file_type()?;
613613
if child_type.is_dir() {
614-
remove_dir_all_recursive(&child.path())?;
615-
} else if child_type.is_symlink_dir() {
616-
rmdir(&child.path())?;
614+
if child_type.is_reparse_point() {
615+
rmdir(&child.path())?;
616+
} else {
617+
remove_dir_all_recursive(&child.path())?;
618+
}
617619
} else {
618620
unlink(&child.path())?;
619621
}

0 commit comments

Comments
 (0)