From 1f0bf8d7c4b7131c6a8762de02ea01affef4db65 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 14 Nov 2024 17:35:49 -0800 Subject: [PATCH] ls: refactor gobble_file get_scontext MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * src/ls.c (gobble_file): Simplify by pulling get_scontext out of ‘if’. --- src/ls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ls.c b/src/ls.c index 6422022d26..5003608b4d 100644 --- a/src/ls.c +++ b/src/ls.c @@ -3496,12 +3496,12 @@ gobble_file (char const *name, enum filetype type, ino_t inode, if (type == directory && command_line_arg && !immediate_dirs) f->filetype = type = arg_directory; + bool get_scontext = (format == long_format) | print_scontext; bool check_capability = format_needs_capability & (type == normal); - if ((format == long_format) | print_scontext | check_capability) + if (get_scontext | check_capability) { struct aclinfo ai; - bool get_scontext = (format == long_format) | print_scontext; int aclinfo_flags = ((do_deref ? ACL_SYMLINK_FOLLOW : 0) | (get_scontext ? ACL_GET_SCONTEXT : 0) | filetype_d_type[type]); -- 2.47.3