From dcf53c1590b741a16e92c7e5a306e923827ae301 Mon Sep 17 00:00:00 2001 From: Peter Atashian Date: Thu, 1 Feb 2018 20:35:50 -0500 Subject: Rewrite remove_dir_all to be correct The fact that this had to be rewritten does not bode well --- src/libstd/sys/windows/fs.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/libstd/sys/windows') diff --git a/src/libstd/sys/windows/fs.rs b/src/libstd/sys/windows/fs.rs index 001e7ceeb71..87a09925313 100644 --- a/src/libstd/sys/windows/fs.rs +++ b/src/libstd/sys/windows/fs.rs @@ -611,9 +611,11 @@ fn remove_dir_all_recursive(path: &Path) -> io::Result<()> { let child = child?; let child_type = child.file_type()?; if child_type.is_dir() { - remove_dir_all_recursive(&child.path())?; - } else if child_type.is_symlink_dir() { - rmdir(&child.path())?; + if child_type.is_reparse_point() { + rmdir(&child.path())?; + } else { + remove_dir_all_recursive(&child.path())?; + } } else { unlink(&child.path())?; } -- cgit 1.4.1-3-g733a5