From 4d711d5f3b3b26854937b5efcd3e12a345a4548d Mon Sep 17 00:00:00 2001 From: luowei Date: Mon, 18 Aug 2025 16:56:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E9=80=80ls=20hidden=E6=96=B9=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: luowei --- toys/posix/ls.c | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/toys/posix/ls.c b/toys/posix/ls.c index e8fa135..2979d9c 100644 --- a/toys/posix/ls.c +++ b/toys/posix/ls.c @@ -305,22 +305,6 @@ static int move_dir_back(struct dirtree **sort, unsigned long dtlen) } #endif -#ifdef TOYBOX_OH_ADAPT -#define ENABLE_HIDDEN_STR "1" -#define ENABLE_HIDDEN_STR_LEN 1 -#define ATTR_VALUE_LEN 8 -int is_file_hidden(const char *path) { - char value[ATTR_VALUE_LEN]; - ssize_t ret = xattr_get(path, "user.filemanager.hidden", &value, sizeof(value) - 1); - if (ret >= 0 && ret < ATTR_VALUE_LEN) { - value[ret] = '\0'; - } else { - value[0] = '\0'; - } - return (ret == ENABLE_HIDDEN_STR_LEN) && !strncmp(ENABLE_HIDDEN_STR, value, sizeof(value)); -} -#endif - // callback from dirtree_recurse() determining how to handle this entry. static int filter(struct dirtree *new) @@ -350,19 +334,6 @@ static int filter(struct dirtree *new) if (FLAG(a)||FLAG(f)) return DIRTREE_SAVE; if (!FLAG(A) && *new->name=='.') return 0; -#ifdef TOYBOX_OH_ADAPT - if (!FLAG(A)) { - char *path = dirtree_path(new, 0); - if (path) { - int is_hidden = is_file_hidden(path); - free(path); - path = NULL; - if (is_hidden) { - return 0; - } - } - } -#endif return dirtree_notdotdot(new) & DIRTREE_SAVE; } -- Gitee