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>
This commit is contained in:
copilot-swe-agent[bot] 2026-03-31 13:57:45 +00:00 committed by GitHub
parent 9711d6aa25
commit 4873b9a229
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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"\")]
{