diff options
author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-06-13 08:02:45 +0000 |
---|---|---|
committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-06-13 08:02:45 +0000 |
commit | 553460f253c025d4b1f319c1513c0259dc4b7934 (patch) | |
tree | 64925420925deb361a2024b9b362e5c987334124 /ls.c | |
parent | 0206172be8940d86e81f52636d2dd9dbcd32388b (diff) | |
download | busybox-w32-553460f253c025d4b1f319c1513c0259dc4b7934.tar.gz busybox-w32-553460f253c025d4b1f319c1513c0259dc4b7934.tar.bz2 busybox-w32-553460f253c025d4b1f319c1513c0259dc4b7934.zip |
I reworked make_human_readable_str so it now has a sane interface,
and then fixed up df, du, and ls to use the new interface. I also
fixed up some formatting issues in ls while I was in there.
-Erik
git-svn-id: svn://busybox.net/trunk/busybox@2826 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'ls.c')
-rw-r--r-- | ls.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -610,8 +610,8 @@ static int list_single(struct dnode *dn) | |||
610 | break; | 610 | break; |
611 | case LIST_BLOCKS: | 611 | case LIST_BLOCKS: |
612 | #ifdef BB_FEATURE_HUMAN_READABLE | 612 | #ifdef BB_FEATURE_HUMAN_READABLE |
613 | fprintf(stdout, "%5s ", make_human_readable_str(dn->dstat.st_blocks>>1, | 613 | fprintf(stdout, "%4s ", make_human_readable_str(dn->dstat.st_blocks>>1, |
614 | (ls_disp_hr==TRUE)? 0: 1)); | 614 | KILOBYTE, (ls_disp_hr==TRUE)? 0: 1)); |
615 | #else | 615 | #else |
616 | #if _FILE_OFFSET_BITS == 64 | 616 | #if _FILE_OFFSET_BITS == 64 |
617 | printf("%4lld ", dn->dstat.st_blocks>>1); | 617 | printf("%4lld ", dn->dstat.st_blocks>>1); |
@@ -622,7 +622,7 @@ static int list_single(struct dnode *dn) | |||
622 | column += 5; | 622 | column += 5; |
623 | break; | 623 | break; |
624 | case LIST_MODEBITS: | 624 | case LIST_MODEBITS: |
625 | printf("%10s", (char *)mode_string(dn->dstat.st_mode)); | 625 | printf("%-10s ", (char *)mode_string(dn->dstat.st_mode)); |
626 | column += 10; | 626 | column += 10; |
627 | break; | 627 | break; |
628 | case LIST_NLINKS: | 628 | case LIST_NLINKS: |
@@ -634,7 +634,7 @@ static int list_single(struct dnode *dn) | |||
634 | my_getpwuid(scratch, dn->dstat.st_uid); | 634 | my_getpwuid(scratch, dn->dstat.st_uid); |
635 | printf("%-8.8s ", scratch); | 635 | printf("%-8.8s ", scratch); |
636 | my_getgrgid(scratch, dn->dstat.st_gid); | 636 | my_getgrgid(scratch, dn->dstat.st_gid); |
637 | printf("%-8.8s", scratch); | 637 | printf("%-8.8s ", scratch); |
638 | column += 17; | 638 | column += 17; |
639 | break; | 639 | break; |
640 | #endif | 640 | #endif |
@@ -649,8 +649,7 @@ static int list_single(struct dnode *dn) | |||
649 | } else { | 649 | } else { |
650 | #ifdef BB_FEATURE_HUMAN_READABLE | 650 | #ifdef BB_FEATURE_HUMAN_READABLE |
651 | if (ls_disp_hr==TRUE) { | 651 | if (ls_disp_hr==TRUE) { |
652 | fprintf(stdout, "%9s ", make_human_readable_str( | 652 | fprintf(stdout, "%8s ", make_human_readable_str(dn->dstat.st_size, 1, 0)); |
653 | dn->dstat.st_size>>10, 0)); | ||
654 | } else | 653 | } else |
655 | #endif | 654 | #endif |
656 | { | 655 | { |