Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107099507
D48329.id148798.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
649 B
Referenced Files
None
Subscribers
None
D48329.id148798.diff
View Options
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,18 @@
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 {
+ char totbuf[] = "total 1024 MB";
+
+ humanize_number(totbuf + 6, 7, dp->btotal * 512, "",
+ HN_AUTOSCALE, HN_B | HN_DECIMAL);
+
+ (void)printf("%s in %lu blocks\n", totbuf, blocks);
+ }
}
for (p = dp->list; p; p = p->fts_link) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 11, 2:47 AM (17 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15707296
Default Alt Text
D48329.id148798.diff (649 B)
Attached To
Mode
D48329: ls -h: humanize the total as well
Attached
Detach File
Event Timeline
Log In to Comment