diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-10-03 11:45:07 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-10-03 11:45:07 +0200 |
commit | 1d63f046d042bff32501ed0ef503dd77b9ca9b0a (patch) | |
tree | 68da358849a26cc1fc491af2d1abdcb175a3c14e /coreutils | |
parent | cae409c6aa2bc649be5a76639b242f672bc2a86e (diff) | |
download | busybox-w32-1d63f046d042bff32501ed0ef503dd77b9ca9b0a.tar.gz busybox-w32-1d63f046d042bff32501ed0ef503dd77b9ca9b0a.tar.bz2 busybox-w32-1d63f046d042bff32501ed0ef503dd77b9ca9b0a.zip |
ls: forgotten chunk from prev commit
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/ls.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/coreutils/ls.c b/coreutils/ls.c index f8416898b..a067aa36c 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c | |||
@@ -592,13 +592,15 @@ static void showfiles(struct dnode **dn, unsigned nfiles) | |||
592 | * number of units. | 592 | * number of units. |
593 | */ | 593 | */ |
594 | /* by Jorgen Overgaard (jorgen AT antistaten.se) */ | 594 | /* by Jorgen Overgaard (jorgen AT antistaten.se) */ |
595 | static off_t calculate_blocks(struct dnode **dn, int nfiles) | 595 | static off_t calculate_blocks(struct dnode **dn) |
596 | { | 596 | { |
597 | uoff_t blocks = 1; | 597 | uoff_t blocks = 1; |
598 | while (nfiles) { | 598 | if (dn) { |
599 | blocks += (*dn)->dstat.st_blocks; /* in 512 byte blocks */ | 599 | while (*dn) { |
600 | dn++; | 600 | /* st_blocks is in 512 byte blocks */ |
601 | nfiles--; | 601 | blocks += (*dn)->dstat.st_blocks; |
602 | dn++; | ||
603 | } | ||
602 | } | 604 | } |
603 | 605 | ||
604 | /* Even though standard says use 512 byte blocks, coreutils use 1k */ | 606 | /* Even though standard says use 512 byte blocks, coreutils use 1k */ |