Commit Graph

1663 Commits

Author SHA1 Message Date
Denys Vlasenko
fca0ee5959 ls: make "ls -s DIR" show total too. Clases 4946
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-27 15:40:26 +01:00
Denys Vlasenko
69a12fa790 catv: suppress compiler warning
The warning was:
warning: typedef 'BUG_const_mismatch' locally defined but not used [-Wunused-local-typedefs]

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-03 03:27:53 +01:00
Mike Frysinger
29ed580668 uname: fix up usage documentation
The -i/-o options were missing, and the -r/-s/-v options were
incorrectly labeled as "OS" instead of "kernel".

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2014-01-31 00:28:42 -05:00
Bartosz Golaszewski
5c13ab41bb sort: check global flags on fallback sort
Sort now performs global reverse on fallback sort if -r is set. Before
only key local flags were checked.

function                                             old     new   delta
compare_keys                                         712     738     +26

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-19 09:10:14 +01:00
Bartosz Golaszewski
1a4d9f6521 sort.c: remove a magic number from compare_keys()
Use bitwise OR of proper flags instead.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-19 06:47:06 +01:00
Cristian Ionescu-Idbohrn
1bdbf26454 tail: adjust help/usage texts
Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-10 16:26:15 +01:00
Denys Vlasenko
16ca379b55 chown: fix help text
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-09 17:52:13 +01:00
Michael Tokarev
22bb81fa85 expand: use printable_string instead of hard-coding implementation
function                                             old     new   delta
expand_main                                          709     690     -19

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-12-16 03:38:24 +01:00
Denys Vlasenko
327f550669 Use unsigned printf/scanf conversion where more appropriate
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-11-29 16:45:45 +01:00
Bartosz Golaszewski
64938011f3 tail compat: fix header printing for tail -f
Makes tail -f for multiple files display the header only if another (ie. not
currently displayed) file changed.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-10-16 15:02:50 +02:00
Denys Vlasenko
b5352078a7 touch: add conditional support for -h
Based on a patch by Andy <andy.padavan@gmail.com>

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-09-11 11:58:33 +02:00
Denys Vlasenko
0ff0b320a2 dd: code shrink
function                                             old     new   delta
dd_main                                             1475    1469      -6

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-08-20 12:49:28 +02:00
Denys Vlasenko
1b57fe108f dd: code shrink
function                                             old     new   delta
dd_main                                             1487    1475     -12

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-08-20 12:45:05 +02:00
Denys Vlasenko
f3114a3bd0 dd: code shrink
function                                             old     new   delta
write_and_stats                                       78      99     +21
dd_main                                             1496    1487      -9
full_write_or_warn                                    42       -     -42
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/1 up/down: 21/-51)            Total: -30 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-08-20 12:40:29 +02:00
Denys Vlasenko
90e9cfd218 dd: remove FIXME comment which is fixed now. No code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-08-20 12:27:19 +02:00
Denys Vlasenko
4502bb1f21 dd: code shrink
function                                             old     new   delta
dd_main                                             1001     961     -40

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-08-20 12:08:46 +02:00
Denys Vlasenko
5b9910f0a4 dd: fail if swab is attempted on odd-sized block
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-08-20 02:50:49 +02:00
Denys Vlasenko
8395bd3f52 dd: fix example in a comment. No code changes.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-08-19 10:30:55 +02:00
Denys Vlasenko
b941316ae5 dd: support conv=swab
function                                             old     new   delta
dd_main                                             1482    1520     +38
static.conv_words                                     28      33      +5
packed_usage                                       29377   29375      -2

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-08-19 09:01:39 +02:00
Denys Vlasenko
4b1896cd2c dd: do not reuse local variables for unrelated values.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-08-19 09:00:08 +02:00
Denys Vlasenko
982e87f2fb Whitespace fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-07-30 11:52:58 +02:00
Denys Vlasenko
bfa6ed1bf4 catv: code shrink
catv_main                                            250     227     -23

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-07-30 11:41:58 +02:00
Bartosz Golaszewski
79c618c411 Refactor catv. Move visible() from stty to libbb.
Fixes the following TODO:

  stty's visible() function and catv's guts are identical. Merge them into
  an appropriate libbb function.

Also makes catv behave exactly like coreutils' cat -v e.g. it'll print 'M-^I'
instead of 'M-   '.

function                                             old     new   delta
visible                                                -      70     +70
do_display                                           431     379     -52
catv_main                                            306     250     -56
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/2 up/down: 70/-108)           Total: -38 bytes

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-07-30 06:29:42 +02:00
Denys Vlasenko
c72b43c2f0 Commonalize typical [b,]k,m suffix struct
function                                             old     new   delta
bkm_suffixes                                           -      32     +32
static.km_suffixes                                    24       -     -24
suffixes                                              32       -     -32
static.bkm                                            32       -     -32
head_tail_suffixes                                    32       -     -32
------------------------------------------------------------------------------
(add/remove: 2/6 grow/shrink: 0/0 up/down: 72/-160)           Total: -88 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-07-13 23:49:45 +02:00
Denys Vlasenko
d87fcd4888 tail: code shrink
function                                             old     new   delta
tail_main                                           1548    1613     +65
tail_read                                            136      34    -102
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 65/-102)           Total: -37 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-07-08 02:39:51 +02:00
Cristian Ionescu-Idbohrn
4f9fc1e5f5 foo*sum: Correct syntax error
coreutils/md5_sha1_sum.c:156:3: error: expected '}' before 'else'

Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-07-04 11:33:42 +02:00
Denys Vlasenko
6651e42609 tail: track file size only in -f mode
This eliminates extra fstat and lseek calls on every read

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-07-02 20:09:15 +02:00
Denys Vlasenko
cd8eece88e foo*sum: report I/O errors, don't merely exit with 1.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-07-02 19:11:01 +02:00
Denys Vlasenko
ae0cf2a9d7 stty: disable CIBAUD leak check - it is not necessary on Linux
function                                             old     new   delta
stty_main                                           1233    1196     -37

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-05-17 20:08:12 +02:00
Denys Vlasenko
e9581b673c stty: code shrink
function                                             old     new   delta
set_mode                                             759     725     -34

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-05-17 18:06:49 +02:00
Denys Vlasenko
8f2cb7ab26 libbb: introduce and use strftime_[YYYYMMDD]HHMMSS()
function                                             old     new   delta
strftime_fmt                                           -      53     +53
strftime_YYYYMMDDHHMMSS                                -      12     +12
strftime_HHMMSS                                        -      12     +12
human_time                                            44      43      -1
fmtstr_t                                               9       -      -9
step_time                                            361     345     -16
watch_main                                           261     232     -29
------------------------------------------------------------------------------
(add/remove: 3/1 grow/shrink: 0/3 up/down: 77/-55)             Total: 22 bytes
   text	   data	    bss	    dec	    hex	filename
 919203	    932	  17692	 937827	  e4f63	busybox_old
 919209	    932	  17692	 937833	  e4f69	busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-03-29 12:30:33 +01:00
Mike Frysinger
1b49c25e0a readlink: note that our -f is really -e
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-03-12 11:38:03 -04:00
Mike Frysinger
445e7543e8 platform: use KERNEL_VERSION to simplify uClibc version checking
This makes reading the logic (as well as adding new code) a lot simpler,
and fixes one or two cases that were broken due to incorrect sub-version
tests.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-03-12 11:13:22 -04:00
Denys Vlasenko
9bbf6b98c4 hostid: do not output sign-extended host id. Closes 6056
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-03-04 03:04:38 +01:00
Denys Vlasenko
3305c008ed tail: make help text for -n +N syntax more correct
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-02-25 07:24:44 +01:00
Denys Vlasenko
40c6da433f head: support -n -NUM and -c -NUM
function                                             old     new   delta
head_main                                            406     832    +426
packed_usage                                       29234   29252     +18
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 444/0)             Total: 444 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-02-25 01:26:09 +01:00
Denys Vlasenko
af0255f496 head,tail: use common suffix struct. simplify help text.
function                                             old     new   delta
head_tail_suffixes                                     -      32     +32
head_main                                            415     406      -9
packed_usage                                       29252   29234     -18
tail_suffixes                                         32       -     -32
head_suffixes                                         32       -     -32
------------------------------------------------------------------------------
(add/remove: 2/2 grow/shrink: 0/2 up/down: 32/-91)            Total: -59 bytes
   text    data     bss     dec     hex filename
 890474     497    7584  898555   db5fb busybox_old
 890415     497    7584  898496   db5c0 busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-02-25 01:24:32 +01:00
Denys Vlasenko
6830ade6aa whitespace fixes. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-01-15 13:58:01 +01:00
Denys Vlasenko
60cb48ca50 whitespace cleanup. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-01-14 15:57:44 +01:00
Lauri Kasanen
b8173b603f sha3sum: new applet
function                                             old     new   delta
KeccakF                                                -     496    +496
KeccakF_RoundConstants                                 -     192    +192
sha3_hash                                              -     171    +171
sha3_end                                               -      40     +40
hash_file                                            274     299     +25
KeccakF_RotationConstants                              -      25     +25
KeccakF_PiLane                                         -      25     +25
packed_usage                                       29213   29232     +19
sha3_begin                                             -      18     +18
KeccakF_Mod5                                           -      10     +10
applet_names                                        2445    2453      +8
applet_main                                         1420    1424      +4
applet_nameofs                                       710     712      +2
------------------------------------------------------------------------------
(add/remove: 8/0 grow/shrink: 9/7 up/down: 1049/-54)         Total: ~995 bytes

Signed-off-by: Lauri Kasanen <curaga@operamail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-01-14 05:20:50 +01:00
Denys Vlasenko
6967578728 whitespace fixes. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-01-14 01:34:48 +01:00
Denys Vlasenko
393c395ca5 du: document incompatibility with standard tool
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-12-14 17:14:11 +01:00
Denys Vlasenko
9371043698 fix unsafe bb_perror_msg(filename) calls
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-09-27 15:35:10 +02:00
Denys Vlasenko
e3e0d2b812 tweak help text
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-06-19 12:46:59 +02:00
Tias Guns
a1ec841913 android: fix 'stat', ifdef S_TYPEIS* in coreutiles/stat.c
patch modified from 'BusyBox Patch V1.0 (Vitaly Greck)'
https://code.google.com/p/busybox-android/downloads/detail?name=patch_busybox

Signed-off-by: Tias Guns <tias@ulyssis.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-06-10 14:20:42 +02:00
Simon B
f1f8fcaad5 mv: accept but ignore -v
function                                             old     new   delta
mv_longopts                                           36      46     +10

Signed-off-by: Simon B <sburnet@hotmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-05-06 18:08:24 +02:00
Simon B
3698ed1ca1 mkdir,rmdir: accept and ignore -v, --verbose
function                                             old     new   delta
static.rmdir_longopts                                 38      48     +10
mkdir_longopts                                        18      28     +10

Signed-off-by: Simon B <sburnet@hotmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-05-06 15:03:32 +02:00
Simon B
44642d1ec1 ln: support -T and -v
function                                             old     new   delta
ln_main                                              445     524     +79
packed_usage                                       29182   29179      -3

Signed-off-by: Simon B <sburnet@hotmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-05-06 13:18:35 +02:00
Denys Vlasenko
b110e1fecb who: fix typo in help text
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-04-18 14:38:15 +02:00
Denys Vlasenko
53772869bc who,less: tweaked help text
function                                             old     new   delta
packed_usage                                       29176   29173      -3

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-04-17 16:11:25 +02:00