From 6856ce0bf40f6c8376592d72294473d2494e361c Mon Sep 17 00:00:00 2001 From: Pat Laster Date: Sat, 8 Oct 2022 16:51:14 -0500 Subject: [PATCH] Fixed handle_writable_directory on windows --- src/uu/rm/src/rm.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/uu/rm/src/rm.rs b/src/uu/rm/src/rm.rs index bd8cb7dcb..a72a88393 100644 --- a/src/uu/rm/src/rm.rs +++ b/src/uu/rm/src/rm.rs @@ -535,8 +535,8 @@ fn handle_writable_directory(path: &Path, options: &Options, metadata: &Metadata fn handle_writable_directory(path: &Path, options: &Options, metadata: &Metadata) -> bool { use std::os::windows::prelude::MetadataExt; use winapi::um::winnt::FILE_ATTRIBUTE_READONLY; - let user_writable = (metadata.file_attributes() & FILE_ATTRIBUTE_READONLY) != 0; - if !user_writable { + let not_user_writable = (metadata.file_attributes() & FILE_ATTRIBUTE_READONLY) != 0; + if not_user_writable { prompt(&(format!("remove write-protected directory {}? ", path.quote()))) } else if options.interactive == InteractiveMode::Always { prompt(&(format!("remove directory {}? ", path.quote())))