From 0ba86d7eb8c650e681b0942a7c1c4101b6ff2732 Mon Sep 17 00:00:00 2001 From: Justin Ma Date: Fri, 20 May 2022 22:27:21 +0800 Subject: [PATCH] Fix #5578, assume pipe file be zero-sized (#5594) * Fix #5578, assume pipe file be zero-sized * rust fmt --- crates/nu-command/src/filesystem/ls.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/nu-command/src/filesystem/ls.rs b/crates/nu-command/src/filesystem/ls.rs index 2615b1e681..0210cb691a 100644 --- a/crates/nu-command/src/filesystem/ls.rs +++ b/crates/nu-command/src/filesystem/ls.rs @@ -451,8 +451,10 @@ pub(crate) fn dir_entry_dict( cols.push("size".to_string()); if let Some(md) = metadata { - let zero_sized = - file_type == "socket" || file_type == "block device" || file_type == "char device"; + let zero_sized = file_type == "pipe" + || file_type == "socket" + || file_type == "char device" + || file_type == "block device"; if md.is_dir() { if du {