From 71e91a0d5d735ac3b39786a59fa478643a147776 Mon Sep 17 00:00:00 2001 From: Sanpi Date: Sat, 7 Oct 2023 10:39:19 +0200 Subject: [PATCH] ls: fix panic when file removed too quickly Fixes #5371 --- src/uu/ls/src/ls.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uu/ls/src/ls.rs b/src/uu/ls/src/ls.rs index 301aefaf3a3..e381162dcb7 100644 --- a/src/uu/ls/src/ls.rs +++ b/src/uu/ls/src/ls.rs @@ -2888,7 +2888,7 @@ fn classify_file(path: &PathData, out: &mut BufWriter) -> Option { Some('=') } else if file_type.is_fifo() { Some('|') - } else if file_type.is_file() && file_is_executable(path.md(out).as_ref().unwrap()) { + } else if file_type.is_file() && path.md(out).map(file_is_executable).unwrap_or_default() { Some('*') } else { None