Bug 4946 - ls-s-works fails due to missing "total" in ls -s
Summary: ls-s-works fails due to missing "total" in ls -s
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Networking (show other bugs)
Version: unspecified
Hardware: Other Linux
: P5 minor
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-17 20:05 UTC by Basil Nutmeg
Modified: 2014-02-27 14:41 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Basil Nutmeg 2012-03-17 20:05:51 UTC
Test ls-s-works fails because GNU "ls -s" prints a "total" line,
while busybox "ls -s" does not. For example:

$ ./busybox ls -s applets_sh
     4 README       4 dos2unix       4 nologin      4 tac          4 unix2dos
$ ls -s applets_sh
total 20
4 dos2unix  4 nologin  4 README  4 tac  4 unix2dos

Busybox ls already has code for printing a total, however it is
only enabled in "ls -l", not "ls -s". This code is in function
scan_and_display_dirs_recur, where it calls calculate_blocks and
prints the result. It should be enabled when the LIST_BLOCKS
option (-s) is active also.
Comment 1 Denys Vlasenko 2014-02-27 14:41:25 UTC
Fixed in git:

commit fca0ee5959f212e46b9a5bb324a1482899172750
Author: Denys Vlasenko <vda.linux@googlemail.com>
Date:   Thu Feb 27 15:40:26 2014 +0100

    ls: make "ls -s DIR" show total too