From 9ce09549afb47ae78fcbd7f71c5374ec7a555f39 Mon Sep 17 00:00:00 2001 From: des Date: Tue, 18 Oct 2011 13:10:46 +0000 Subject: When calculating the width of the blocksize column, ls(1) used 512-byte units (as returned by stat(2)) instead of BLOCKSIZE units. Submitted by: Paul Schenkeveld MFC after: 3 weeks --- bin/ls/ls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin/ls') diff --git a/bin/ls/ls.c b/bin/ls/ls.c index 569f3d9..29471a6 100644 --- a/bin/ls/ls.c +++ b/bin/ls/ls.c @@ -44,7 +44,7 @@ static char sccsid[] = "@(#)ls.c 8.5 (Berkeley) 4/2/94"; #include __FBSDID("$FreeBSD$"); -#include +#include #include #include #include @@ -835,7 +835,7 @@ label_out: d.maxlen = maxlen; if (needstats) { d.btotal = btotal; - d.s_block = snprintf(NULL, 0, "%lu", maxblock); + d.s_block = snprintf(NULL, 0, "%lu", howmany(maxblock, blocksize)); d.s_flags = maxflags; d.s_label = maxlabelstr; d.s_group = maxgroup; -- cgit v1.1