From 39aa34b78bbe164e619a4b40124d5e67c60b58c5 Mon Sep 17 00:00:00 2001 From: hongll Date: Sun, 17 Aug 2025 16:34:29 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3ls=20=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E6=8E=92=E7=89=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: h60047265 --- toys/posix/ls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toys/posix/ls.c b/toys/posix/ls.c index e8fa135..8fca832 100644 --- a/toys/posix/ls.c +++ b/toys/posix/ls.c @@ -346,7 +346,7 @@ static int filter(struct dirtree *new) if (FLAG(u)) new->st.st_mtime = new->st.st_atime; if (FLAG(c)) new->st.st_mtime = new->st.st_ctime; - new->st.st_blocks >>= 1; // Use 1KiB blocks rather than 512B blocks. + new->st.st_blocks = (new->st.st_blocks + 1) >> 1; // Use 1KiB blocks rather than 512B blocks. if (FLAG(a)||FLAG(f)) return DIRTREE_SAVE; if (!FLAG(A) && *new->name=='.') return 0; -- Gitee