From 4873b9a2293ab2314de136dffd2b6e2b45865413 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 31 Mar 2026 13:57:45 +0000 Subject: [PATCH] Polish systemic mount size handling Agent-Logs-Url: https://github.com/sxyazi/yazi/sessions/89d44d10-de98-42c8-bc7b-dc68c41459bb Co-authored-by: sxyazi <17523360+sxyazi@users.noreply.github.com> --- yazi-fs/src/provider/local/calculator.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/yazi-fs/src/provider/local/calculator.rs b/yazi-fs/src/provider/local/calculator.rs index ef91ac63..0df0867a 100644 --- a/yazi-fs/src/provider/local/calculator.rs +++ b/yazi-fs/src/provider/local/calculator.rs @@ -153,9 +153,11 @@ fn systemic_mounts_from(root: &Path, mounts: &str) -> SystemicMounts { let dist = unmangle_octal(it.next()?); let fstype = unmangle_octal(it.next()?); let dist = PathBuf::from(dist.as_ref()); - (Partition { fstype: Some(fstype.into_owned().into()), ..Default::default() }.systemic() - && (dist == root || dist.starts_with(root))) - .then_some(dist) + let systemic = Partition { fstype: Some(fstype.into_owned().into()), ..Default::default() } + .systemic(); + let descendant = dist == root || dist.starts_with(root); + + (systemic && descendant).then_some(dist) }) .collect() } @@ -165,6 +167,7 @@ fn unmangle_octal(s: &str) -> std::borrow::Cow<'_, str> { use yazi_shared::replace_cow; let mut s = std::borrow::Cow::Borrowed(s); + // `/proc/mounts` escapes tabs, newlines, spaces, `#`, and `\` using octal sequences. for (a, b) in [(r"\011", "\t"), (r"\012", "\n"), (r"\040", " "), (r"\043", "#"), (r"\134", r"\")] {