Page MenuHomeFreeBSD

D48329.id148817.diff
No OneTemporary

D48329.id148817.diff

diff --git a/bin/ls/print.c b/bin/ls/print.c
--- a/bin/ls/print.c
+++ b/bin/ls/print.c
@@ -216,7 +216,16 @@
if ((dp->list == NULL || dp->list->fts_level != FTS_ROOTLEVEL) &&
(f_longform || f_size)) {
- (void)printf("total %lu\n", howmany(dp->btotal, blocksize));
+ u_long blocks = howmany(dp->btotal, blocksize);
+
+ if (!f_humanval)
+ (void)printf("total %lu\n", blocks);
+ else {
+ (void)humanize_number(buf, 7 /* "1024 KB" */,
+ dp->btotal * 512, "B", HN_AUTOSCALE, HN_DECIMAL);
+
+ (void)printf("total %s in %lu blocks\n", buf, blocks);
+ }
}
for (p = dp->list; p; p = p->fts_link) {

File Metadata

Mime Type
text/plain
Expires
Sat, Jan 11, 9:06 AM (18 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15715235
Default Alt Text
D48329.id148817.diff (622 B)

Event Timeline