From 23cd9a087ce7bb46bdeccd7bec2830f632aba604 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Tue, 15 Oct 2024 20:36:09 +0800 Subject: [PATCH] Fix Windows --- yazi-shared/src/fs/cha.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/yazi-shared/src/fs/cha.rs b/yazi-shared/src/fs/cha.rs index db562146..14a08089 100644 --- a/yazi-shared/src/fs/cha.rs +++ b/yazi-shared/src/fs/cha.rs @@ -141,20 +141,22 @@ impl Cha { #[inline] pub fn new_nofollow(path: &Path, meta: Metadata) -> Self { - let mut cha = Self::from(meta); + let mut attached = ChaKind::empty(); #[cfg(unix)] if Urn::new(path).is_hidden() { - cha.kind |= ChaKind::HIDDEN; + attached |= ChaKind::HIDDEN; } #[cfg(windows)] { use std::os::windows::fs::MetadataExt; if meta.file_attributes() & 2 != 0 { - cha.kind |= ChaKind::HIDDEN; + attached |= ChaKind::HIDDEN; } } + let mut cha = Self::from(meta); + cha.kind |= attached; cha }