aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/ls.c13
-rw-r--r--coreutils/md5_sha1_sum.c10
2 files changed, 14 insertions, 9 deletions
diff --git a/coreutils/ls.c b/coreutils/ls.c
index 58b8fde75..d8cfe27d3 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -505,9 +505,16 @@ static NOINLINE unsigned display_single(const struct dnode *dn)
505#else 505#else
506 column += printf("%19"LL_FMT"u ", (long long) dn->dn_ino); 506 column += printf("%19"LL_FMT"u ", (long long) dn->dn_ino);
507#endif 507#endif
508//TODO: -h should affect -s too: 508 if (opt & OPT_s) { /* show allocated blocks */
509 if (opt & OPT_s) /* show allocated blocks */ 509 if (opt & OPT_h) {
510 column += printf("%6"OFF_FMT"u ", (off_t) (dn->dn_blocks >> 1)); 510 column += printf("%"HUMAN_READABLE_MAX_WIDTH_STR"s ",
511 /* print size, show one fractional, use suffixes */
512 make_human_readable_str((off_t)dn->dn_blocks << 9, 1, 0)
513 );
514 } else {
515 column += printf("%6"OFF_FMT"u ", (off_t)(dn->dn_blocks >> 1));
516 }
517 }
511 if (opt & OPT_l) { 518 if (opt & OPT_l) {
512 /* long listing: show mode */ 519 /* long listing: show mode */
513 char modestr[12]; 520 char modestr[12];
diff --git a/coreutils/md5_sha1_sum.c b/coreutils/md5_sha1_sum.c
index 3b389cb6b..0e57673f1 100644
--- a/coreutils/md5_sha1_sum.c
+++ b/coreutils/md5_sha1_sum.c
@@ -300,12 +300,10 @@ int md5_sha1_sum_main(int argc UNUSED_PARAM, char **argv)
300 char *filename_ptr; 300 char *filename_ptr;
301 301
302 count_total++; 302 count_total++;
303 filename_ptr = strstr(line, " "); 303 filename_ptr = strchr(line, ' ');
304 /* handle format for binary checksums */ 304 if (filename_ptr == NULL
305 if (filename_ptr == NULL) { 305 || (filename_ptr[1] != ' ' && filename_ptr[1] != '*')
306 filename_ptr = strstr(line, " *"); 306 ) {
307 }
308 if (filename_ptr == NULL) {
309 if (flags & FLAG_WARN) { 307 if (flags & FLAG_WARN) {
310 bb_simple_error_msg("invalid format"); 308 bb_simple_error_msg("invalid format");
311 } 309 }