about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorPeter Atashian <retep998@gmail.com>2018-02-01 20:35:50 -0500
committerPeter Atashian <retep998@gmail.com>2018-02-01 20:35:50 -0500
commitdcf53c1590b741a16e92c7e5a306e923827ae301 (patch)
treeef9fb09d336f430238e58e406504493f313aa719 /src/libstd/sys
parentb1b9edf5ae3c6a8a862e480174f9fefafeba7143 (diff)
downloadrust-dcf53c1590b741a16e92c7e5a306e923827ae301.tar.gz
rust-dcf53c1590b741a16e92c7e5a306e923827ae301.zip
Rewrite remove_dir_all to be correct
The fact that this had to be rewritten does not bode well
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/windows/fs.rs8
1 files changed, 5 insertions, 3 deletions
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())?;
         }