diff options
author | Jim Meyering <jim@meyering.net> | 1998-07-13 00:17:57 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1998-07-13 00:17:57 +0000 |
commit | 6cdd12a9f212ee9de7f50b420f3ed869512bc26b (patch) | |
tree | 7935439fc73507d15642eec918be99bd865fec21 /src | |
parent | a0ec87fbf980292ea0a861f2f09e013272e0cd53 (diff) | |
download | coreutils-6cdd12a9f212ee9de7f50b420f3ed869512bc26b.tar.gz coreutils-6cdd12a9f212ee9de7f50b420f3ed869512bc26b.tar.bz2 coreutils-6cdd12a9f212ee9de7f50b420f3ed869512bc26b.zip |
(print_header): Print "1k-blocks", not "1.0k-blocks".
Diffstat (limited to 'src')
-rw-r--r-- | src/df.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -146,8 +146,14 @@ print_header (void) else { char buf[LONGEST_HUMAN_READABLE + 1]; - printf (" %4s-blocks Used Available Use%%", - human_readable (output_block_size, buf, 1, -1024)); + char *p = human_readable (output_block_size, buf, 1, -1024); + + /* Replace e.g. "1.0k" by "1k". */ + size_t plen = strlen (p); + if (3 <= plen && strncmp (p + plen - 3, ".0", 2) == 0) + strcpy (p + plen - 3, p + plen - 1); + + printf (" %4s-blocks Used Available Use%%", p); } printf (" Mounted on\n"); |