[Toybox] [PATCH] ls: fix -h with block counts.

enh enh at google.com
Wed Apr 8 10:44:23 PDT 2020


The filter() function modifies st_blocks so it's always 1KiB rather than
512B blocks, but the human-readable output was still assuming 512B. This
meant that `ls -sh` was showing figures half the size of `ls -s`, and
that the "total" line with -h was also off by a factor of 2.

No new test, because I don't know how to write one that would work on
all file systems.

Bug: http://b/153383721
---
 toys/posix/ls.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ls-fix-h-with-block-counts.patch
Type: text/x-patch
Size: 2208 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20200408/ccc87de0/attachment-0002.bin>


More information about the Toybox mailing list