Commit Graph

1598 Commits

Author SHA1 Message Date
Bernhard Reutner-Fischer
836f36333a tail: document FANCY flags in helptext
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-02-26 18:34:16 +01:00
Bernhard Reutner-Fischer
1359e0d1b9 df: explain FANCY options in helptext
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-02-26 18:21:42 +01:00
Denys Vlasenko
43d9747f6e install: strip before mode/uid/gid is set, not after.
function                                             old     new   delta
install_main                                         694     716     +22
basename                                              21       -     -21

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-02-21 16:55:29 +01:00
Denys Vlasenko
10544a8410 compat and warning fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-02-09 00:26:10 +01:00
Denys Vlasenko
3205c24a82 shaNNNsum: accept and ignore -b and -t
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-02-07 23:28:23 +01:00
Denys Vlasenko
cb7edc2661 adduser: copy /etc/skel to mew homes. +100 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-02-06 21:50:59 +01:00
Denys Vlasenko
0cd445f4d1 cosmetic fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-02-06 21:11:49 +01:00
Denys Vlasenko
98a4c7cf3d *: suppress ~60% of "aliased warnings" on gcc-4.4.1
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-02-04 15:00:15 +01:00
Denys Vlasenko
5b9b1365a0 stat: get rid on intmax_t
function                                             old     new   delta
print_it                                             225     218      -7
print_stat                                           919     889     -30
print_statfs                                         370     339     -31
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-68)             Total: -68 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-02-02 03:08:57 +01:00
Denys Vlasenko
d8528b8e56 ls: unicode fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-31 05:15:38 +01:00
Denys Vlasenko
ed910c750d cal: add a unicode test
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-31 00:10:18 +01:00
Denys Vlasenko
e17764c8fb further work on unicodization
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-30 23:16:21 +01:00
Denys Vlasenko
6b9f163353 *: style fixes. no code changes (verified with objdump)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-28 02:24:24 +01:00
Denys Vlasenko
6b01b71e83 randomconfig fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-24 22:52:21 +01:00
Denys Vlasenko
9f93d62192 libbb: better unicode width support. Hopefully fixes bug 839.
Also opens up a possibility to make other unicode stuff smaller
and more correct later. but:

function                                             old     new   delta
static.combining                                       -     516    +516
bb_wcwidth                                             -     328    +328
unicode_cut_nchars                                     -     141    +141
mbstowc_internal                                       -      93     +93
in_table                                               -      78     +78
cal_main                                             899     961     +62
static.combining0x10000                                -      40     +40
unicode_strlen                                         -      31     +31
bb_mbstrlen                                           31       -     -31
bb_mbstowcs                                          173     102     -71
------------------------------------------------------------------------------
(add/remove: 7/1 grow/shrink: 1/1 up/down: 1289/-102)        Total: 1187 bytes

Uses code of Markus Kuhn, which is in public domain:
http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c
"Permission to use, copy, modify, and distribute this software
 for any purpose and without fee is hereby granted. The author
 disclaims all warranties with regard to this software."

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-24 07:44:03 +01:00
Denys Vlasenko
5da9f96ad8 date: introduce FEATURE_DATE_COMPAT; shrink
function                                             old     new   delta
date_main                                            889     862     -27

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-23 23:37:52 +01:00
Denys Vlasenko
9882b34fe2 chown: -2 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-23 00:13:32 +01:00
Matheus Izvekov
31416d589e chown: support long options
function                                             old     new   delta
chown_longopts                                         -      81     +81
chown_main                                           182     192     +10

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-23 00:10:40 +01:00
Denys Vlasenko
7be97c5b6b ls: fix sort of very large files. +21 byte
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-18 13:02:27 +01:00
Denys Vlasenko
573ba4e92e fix examples which used non-standard cut -b0-NNN
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-18 12:25:09 +01:00
Denys Vlasenko
9c3b84a304 ls: make it so that group never glues itself to file size
+ smaller enhancements: inode is long long; -h is a bit narrower; etc

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-18 01:55:00 +01:00
Denys Vlasenko
a40f0624db cp: fix -H handling
function                                             old     new   delta
copy_file                                           1495    1518     +23

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-15 22:05:07 +01:00
Denys Vlasenko
bb16f57e5d INSTALL: update obsolete doc, as suggested by Doug Clapp (doug.clapp AT triad.rr.com)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-13 22:43:13 +01:00
Denys Vlasenko
c041e239db fix configure sha256sum problem. Closes bug 895
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-13 18:55:37 +01:00
Denys Vlasenko
dc698bb038 *: make it easier to distinquish "struct tm", pointer to one, etc
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-09 19:10:49 +01:00
Denys Vlasenko
86350f8d5f cal: document the location of unicode bug. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-06 10:18:37 +01:00
Denys Vlasenko
28055028a7 fold: unicode support. Based on a patch by Tomas Heinrich <heinrich.tomas@gmail.com>
General Unicode support is tweaked to expose unicode_status.

function                                             old     new   delta
init_unicode                                           -      77     +77
write2stdout                                           -      19     +19
adjust_column                                         68      71      +3
unicode_status                                         -       1      +1
unicode_is_enabled                                     1       -      -1
grep_main                                            780     773      -7
fold_main                                            619     552     -67
check_unicode_in_env                                  77       -     -77
------------------------------------------------------------------------------
(add/remove: 3/2 grow/shrink: 1/2 up/down: 100/-152)          Total: -52 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-04 20:49:58 +01:00
Tomas Heinrich
d2b1ba6fde [un]expand: unicode support
function                                             old     new   delta
expand_main                                          633     663     +30

Signed-off-by: Tomas Heinrich <heinrich.tomas@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-04 16:21:31 +01:00
Denys Vlasenko
2ec91aead5 *: remove some uses of argc
function                                             old     new   delta
whoami_main                                           34      37      +3
logname_main                                          60      63      +3
hostid_main                                           35      38      +3
ttysize_main                                         136     135      -1
nmeter_main                                          673     672      -1
logger_main                                          387     386      -1
uuencode_main                                        330     328      -2
ifupdown_main                                       2125    2123      -2
mesg_main                                            158     155      -3
free_main                                            333     330      -3
cal_main                                             902     899      -3
acpid_main                                           443     440      -3
ar_main                                              196     189      -7
find_main                                            476     467      -9
ifconfig_main                                       1235    1221     -14
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/12 up/down: 9/-49)            Total: -40 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-04 14:15:38 +01:00
Denys Vlasenko
a355da0775 *: make 2 more "int argc"'s unused; more saved if !DESKTOP
function                                             old     new   delta
sync_main                                             18      20      +2
tty_main                                              90      87      -3
iprule_list                                           83      79      -4

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-04 13:16:08 +01:00
Denys Vlasenko
aa42d13e32 sort: make sort -o FILE FILE (same FILE) work. Closes bug 785. -3 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-12-13 02:09:22 +01:00
Denys Vlasenko
800ff7cc75 stty: code shrink -44 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-12-11 15:00:17 +01:00
Denys Vlasenko
9f5a577a32 stty: fix columns command. closes bug 791.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-12-11 14:17:02 +01:00
Denys Vlasenko
a7329667b4 mount: prevent second mount -a from mounting everything again
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-12-05 04:25:19 +01:00
Denys Vlasenko
d0f9d0ed58 touch: needs another fix after last utimes() fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-30 11:36:14 +01:00
Denys Vlasenko
dcbfaba264 fix improper utimes usage
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-29 19:40:36 +01:00
Denys Vlasenko
e992bae6f9 *: remove a few more cases of argc usage. -89 bytes.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-28 15:18:53 +01:00
Denys Vlasenko
5b6fe34cee split: handle - as "use stdin". +13 bytes. Closes bug 741.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-26 05:43:16 +01:00
Denys Vlasenko
11f3a8b7ed od: fix -tx without length spec
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-22 15:37:16 +01:00
Denys Vlasenko
c270454f8f fix fallout from isprint() changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-20 19:14:19 +01:00
Denys Vlasenko
8684cbb5cc libbb: robustify isXXXX(). +39 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-18 11:34:43 +01:00
Dan Fandrich
5b0a7f1a6e wc: fix a hang gue to isprint(EOF)
The new isprint replacement macro returns TRUE for isprint(EOF), so the
read loop never returns. Moved the check for EOF immediately after the
read.

Signed-off-by: Dan Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-18 10:48:09 +01:00
Denys Vlasenko
a7ccdeef39 libbb: added xfdopen_for_read/write
function                                             old     new   delta
xfdopen_helper                                         -      40     +40
logdir_open                                         1163    1184     +21
process_stdin                                        433     443     +10
xfdopen_for_write                                      -       9      +9
doCommands                                          2465    2474      +9
patch_main                                          1214    1222      +8
bbunpack                                             457     465      +8
xfdopen_for_read                                       -       7      +7
scan_tree                                            258     262      +4
xstrtoul_range_sfx                                   230     231      +1
sendmail_main                                        957     955      -2
passwd_main                                         1027    1023      -4
parse                                                969     964      -5
test_main                                            253     247      -6
sed_main                                             655     649      -6
dos2unix_main                                        437     429      -8
fbsplash_main                                        950     938     -12
handle_dir_common                                    371     354     -17
expand_vars_to_list                                 2197    2169     -28
update_passwd                                       1275    1246     -29
------------------------------------------------------------------------------
(add/remove: 3/0 grow/shrink: 7/10 up/down: 117/-117)           Total: 0 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-15 23:28:11 +01:00
Denys Vlasenko
ff1822aed1 date: restore hadling of MMDDhhmm[[CC]YY][.ss] date format
function                                             old     new   delta
date_main                                            698     889    +191

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-15 04:55:40 +01:00
Denys Vlasenko
389cca4b9e some non-gnu compilers can't have non-const struct initializers
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-15 02:28:56 +01:00
Bernhard Reutner-Fischer
a307af1af6 use utimes() rather than obsolescent utime()
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2009-11-15 00:12:53 +01:00
Denys Vlasenko
6331cf059c *: use "can't" instead of "cannot"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-13 09:08:27 +01:00
Denys Vlasenko
f4fee418ae env: don't SEGV on bare "env -"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-12 14:52:47 +01:00
Denys Vlasenko
ab19ede655 tidy up O_NONBLOCK usage. use libbb functions in stty.
Added O_RDONLY where improves readability. Note: O_RDONLY == 0,
so it is there even if not specified.

function                                             old     new   delta
stty_main                                           1289    1235     -54

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-11 21:05:42 +01:00
Denys Vlasenko
ded688c6f6 fold: fix a corner case. By Tomas Heinrich (heinrich.tomas AT gmail.com)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-04 15:31:19 +01:00
Denys Vlasenko
8131eea3dc *: introduce and use ffulsh_all()
function                                             old     new   delta
buffer_fill_and_print                                179     196     +17
fflush_all                                             -       9      +9
spawn                                                 87      92      +5
rtcwake_main                                         455     453      -2
...
alarm_intr                                            93      84      -9
readcmd                                             1072    1062     -10
bb_ask                                               345     333     -12
more_main                                            845     832     -13
flush_stdout_stderr                                   42      23     -19
xfflush_stdout                                        27       -     -27
flush_stderr                                          30       -     -30
------------------------------------------------------------------------------
(add/remove: 1/2 grow/shrink: 2/50 up/down: 31/-397)         Total: -366 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-02 14:19:51 +01:00
Bernhard Reutner-Fischer
95a036e125 tty: use defines rather than constants
No obj-code changes.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2009-10-29 21:37:48 +01:00
Bernhard Reutner-Fischer
a48308701a add and use xopen_nonblocking (-18b)
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-27 17:17:34 +01:00
Denys Vlasenko
0939f2ebd2 fix up potential printf's with unsafe format strings
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-24 17:47:56 +02:00
Denys Vlasenko
d93fc61725 ls: fix "ls | cat" to not show "total NNN" header
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-23 16:22:25 +02:00
Bernhard Reutner-Fischer
ca22cda709 date: handle long options
RFC2822 obsoletes RFC822; Silently accept --rfc-822 and return rfc2822
output for compatibility.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2009-10-23 16:07:37 +02:00
Denys Vlasenko
f2cbb03a37 *: optimize most of isXXXXX() macros
text    data     bss     dec     hex filename
 824164     453    6812  831429   cafc5 busybox_old
 823730     453    6812  830995   cae13 busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-23 03:16:08 +02:00
Denys Vlasenko
c0dab37d0a *: remove last function calls to isspace
function                                             old     new   delta
xstrtoul_range_sfx                                   232     231      -1
xstrtoull_range_sfx                                  295     293      -2
trim                                                  82      80      -2
trim_trailing_spaces_and_print                        57      52      -5
isspace                                               18       -     -18

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-22 22:28:08 +02:00
Denys Vlasenko
a46317b6f3 df: trivial 64-bit fix
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-21 23:28:20 +02:00
Denys Vlasenko
7eabffafa5 dd: use correct multiplication factor and simplify code
function                                             old     new   delta
dd_output_status                                     332     364     +32

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-14 17:43:41 +02:00
Denys Vlasenko
a1a3972f28 dd: add a comment, no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-14 00:49:06 +02:00
Gabor Heja
4e5b07b0fe dd: speed measurement. optional.
function                                             old     new   delta
dd_output_status                                      68     289    +221
dd_main                                             1463    1482     +19
write_and_stats                                       64      75     +11
packed_usage                                       26529   26526      -3
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/1 up/down: 251/-3)            Total: 248 bytes
Signed-off-by: Gabor Heja <kakaopor@kakaopor.hu>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-14 00:29:28 +02:00
Denys Vlasenko
0bf44d00a4 libbb/human_readable.c: shrink; and reduce bss usage
also, move smart_ulltoaN there and comment usage locations

function                                             old     new   delta
static.unit_chars                                      7       9      +2
utoa_to_buf                                          110     108      -2
make_human_readable_str                              262     258      -4
fallbackSort                                        1723    1719      -4
static.fmt                                            97      92      -5
static.fmt_tenths                                     10       -     -10
static.str                                            21       4     -17
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/5 up/down: 2/-42)             Total: -40 bytes
   text    data     bss     dec     hex filename
 820981     453    6932  828366   ca3ce busybox_old
 820968     453    6916  828337   ca3b1 busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-13 01:25:09 +02:00
Denys Vlasenko
d5fddcd57f cp: revert a recent buggy change, and add a comment why it's wrong
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-08 01:32:44 +02:00
Denys Vlasenko
7bb346f23c *: use {i,u}toa() where appropriate
function                                             old     new   delta
startservice                                         377     363     -14
setari_u                                              54      40     -14
ash_main                                            1375    1361     -14
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-42)             Total: -42 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-06 22:09:50 +02:00
Denys Vlasenko
1d63f046d0 ls: forgotten chunk from prev commit
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-03 11:45:07 +02:00
Denys Vlasenko
cae409c6aa ls: code shrink
function                                             old     new   delta
count_dirs                                            81      86      +5
dnalloc                                               13      17      +4
showfiles                                            372     370      -2
ls_main                                              833     825      -8
showdirs                                             505     489     -16
splitdnarray                                         189     120     -69
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/4 up/down: 9/-95)             Total: -86 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-03 11:43:48 +02:00
Denys Vlasenko
ffd4774ad2 ls: fix for !FEATURE_LS_RECURSIVE (forgotten free); cleanups
no code changes if FEATURE_LS_RECURSIVE

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-03 11:42:33 +02:00
Denys Vlasenko
0683d4d633 ls: add standards doc; record author of "total NNNN" code
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-03 10:53:36 +02:00
Denys Vlasenko
76c7d9500a ls: code shrink
function                                             old     new   delta
list_single                                            -    1006   +1006
print_name                                           211     209      -2
dnalloc                                               15      13      -2
splitdnarray                                         192     189      -3
ls_main                                              848     833     -15
showdirs                                             564     505     -59
showfiles                                           1460     372   -1088
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/6 up/down: 1006/-1169)       Total: -163 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-03 01:15:47 +02:00
Denys Vlasenko
87c150c7cc ls: add "total NNNN" header if DESKTOP. By Johannes Stezenbach (js AT sig21.net)
function                                             old     new   delta
showdirs                                             492     564     +72

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-03 01:14:15 +02:00
Denys Vlasenko
88a37689a7 cp: FEATURE_CP_LONG_OPTIONS depends on LONG_OPTS
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-02 01:29:25 +02:00
Denys Vlasenko
1b34d4f0b1 find: add zeroing of G.xxx; ftpd - remove extraneous zeroing of G.xxx
Brought "G trick" to the same shape in a few more places.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-30 02:39:57 +02:00
Denys Vlasenko
48f116198d cp: add support for --parents and long option synonyms of short opts
By Ian Wienand (ianw AT vmware.com)

function                                             old     new   delta
cp_main                                              257     369    +112
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/0 up/down: 112/0)             Total: 112 bytes
   text    data     bss     dec     hex filename
 823000     458    6948  830406   cabc6 busybox_old
 823283     458    6948  830689   cace1 busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-26 14:31:04 +02:00
Denys Vlasenko
200d522fb8 df: unicode-aware column formatting. By Tomas Heinrich (theinric AT redhat.com)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-22 15:34:28 +02:00
Denys Vlasenko
f00cfdfae5 dd: fix conv=noerror w/o sync to not write out zeroed blocks
function                                             old     new   delta
dd_main                                             1480    1463     -17

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-18 20:49:36 +02:00
Denys Vlasenko
c541a8955d test: use index_in_strings
function                                             old     new   delta
ops_texts                                              -     124    +124
ops_table                                              -      80     +80
display_process_list                                1447    1448      +1
binop                                                525     523      -2
static.no_op                                           6       2      -4
check_operator                                        71      63      -8
ops                                                  240       -    -240
------------------------------------------------------------------------------
(add/remove: 2/1 grow/shrink: 1/3 up/down: 205/-254)          Total: -49 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-12 22:41:57 +02:00
Denys Vlasenko
d069e5398d a few more GCC-isms removed
text    data     bss     dec     hex filename
 824641     458    6956  832055   cb237 busybox_old
 824631     458    6956  832045   cb22d busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-09 23:12:10 +02:00
Denys Vlasenko
043b1e5d99 more C standard compat fixes from Dan Fandrich
function                                             old     new   delta
docolon                                              207     204      -3

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-06 12:47:55 +02:00
Denys Vlasenko
44f174e61b uniq: shave off whole 10 bytes off, oh my
text    data     bss     dec     hex filename
 823673     458    6956  831087   cae6f busybox_old
 823663     458    6956  831077   cae65 busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-08-31 05:15:21 +02:00
Denys Vlasenko
1249dbb2c7 uniq: code shrink
function                                             old     new   delta
xgetoptfile_uniq_s                                    44      51      +7
uniq_main                                            389     368     -21
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 7/-21)             Total: -14 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-08-30 19:35:06 +02:00
Denys Vlasenko
a9c9bf5055 uniq: plug memory leak (patch from OpenWRT project)
function                                             old     new   delta
uniq_main                                            371     389     +18

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-08-30 19:34:09 +02:00
Denys Vlasenko
0aec9ff6b8 uniq: rename some variables. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-08-30 19:32:45 +02:00
Denys Vlasenko
79b021d738 tail: read only a portion of a file if it's huge. closes bug 551
function                                             old     new   delta
tail_main                                           1494    1526     +32
tail_read                                            125     129      +4

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-08-10 03:16:18 +02:00
Denys Vlasenko
a43df64eec tail: fix "tail +N file_shorter_than_N"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-08-09 22:06:56 +02:00
Denys Vlasenko
334fcc8fd4 dd: conv=noerror should skip read errors using lseek (bug 539)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-08-05 23:16:27 +02:00
Eric Lammerts
3b5a664440 tail: implement -F
function                                             old     new   delta
tail_main                                           1190    1494    +304

Signed-off-by: Eric Lammerts <busybox@lists.lammerts.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-07-22 00:31:27 +02:00
Denys Vlasenko
6ae6426a74 fix mountpoint test to not prevemt mkfs_xxx from making image in any file
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-07-18 16:22:26 +02:00
Denys Vlasenko
38dd8aa657 touch: implement -t TIME (needed for testsuite)
This changes date -d TIME format a bit, makes it more compatible

function                                             old     new   delta
parse_datestr                                        391     618    +227
touch_main                                           360     361      +1
packed_usage                                       26624   26615      -9

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-07-18 04:49:20 +02:00
Denys Vlasenko
7aca89a7a3 touch: implement -d --date (our own testsuite needs that)
function                                             old     new   delta
static.uname_longopts                                  -     137    +137
touch_main                                           231     360    +129
static.touch_longopts                                  -      32     +32
validate_tm_time                                       -      28     +28
packed_usage                                       26616   26624      +8
date_main                                            687     686      -1
static.longopts                                      162       -    -162
------------------------------------------------------------------------------
(add/remove: 3/1 grow/shrink: 2/1 up/down: 334/-163)          Total: 171 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-07-18 03:41:29 +02:00
Denys Vlasenko
73b71f381d date: factor out date parsing (in preparation for touch -d)
function                                             old     new   delta
parse_datestr                                          -     391    +391
sha512_process_block128                             1283    1310     +27
buffer_fill_and_print                                179     196     +17
nexpr                                                826     840     +14
unzip_main                                          1931    1939      +8
popstring                                            134     140      +6
qrealloc                                              33      36      +3
builtin_umask                                        121     123      +2
evalvar                                             1365    1363      -2
changepath                                           194     192      -2
do_compress                                         1698    1688     -10
hwclock_main                                         340     329     -11
cmdputs                                              414     402     -12
identify                                            4343    4329     -14
date_main                                           1186     687    -499
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 7/7 up/down: 468/-550)          Total: -82 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-07-18 03:40:35 +02:00
Denys Vlasenko
d23f64eba7 test: fix "test !" and "test abc -a !". closes bug 465
function                                             old     new   delta
nexpr                                                826     840     +14

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-07-17 00:59:26 +02:00
Denys Vlasenko
fda8f57360 tweaking Unicode support
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-07-11 22:26:48 +02:00
Denys Vlasenko
42a8fd0db0 added simplified Unicode support for non-locale-enabled builds
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-07-11 21:36:13 +02:00
Denys Vlasenko
da49f58524 move libc related stuff out of platform.h
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-07-08 02:58:38 +02:00
Denys Vlasenko
09e63bb81f df: fix "df /"
also, clean up mount checks in mkfs/fsck.

function                                             old     new   delta
find_mount_point                                     243     261     +18
sha1_process_block64                                 497     510     +13
find_main                                            436     444      +8
display_speed                                         85      90      +5
df_main                                              795     793      -2
parse_command                                       1463    1460      -3
static.ignored_mounts                                  8       -      -8
mkfs_minix_main                                     2962    2937     -25
fsck_minix_main                                     3065    2970     -95
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 4/4 up/down: 44/-133)           Total: -89 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-07-05 04:50:36 +02:00
Denys Vlasenko
9b1b62adc4 Patches to enable FreeBSD build
platform.h: fix wrong check for endianness, fix lchown
aliasing to chown on uclibc.

Code seems to not be affected in my testing.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-07-05 03:34:12 +02:00
Denys Vlasenko
ae05dd42ca ls: make --color more compatible with coreutils
function                                             old     new   delta
static.color_str                                       -      34     +34
static.ls_longopts                                     -       9      +9
ls_color_opt                                           9       -      -9
ls_main                                              865     843     -22
------------------------------------------------------------------------------
(add/remove: 2/1 grow/shrink: 0/1 up/down: 43/-31)             Total: 12 bytes
   text    data     bss     dec     hex filename
 820145     450    7692  828287   ca37f busybox_old
 820144     450    7692  828286   ca37e busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-07-03 12:22:19 +02:00
Denys Vlasenko
5508363fd0 ls: fix --color handling. Closes bug 435.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-07-02 14:25:51 +02:00
Denys Vlasenko
7e6034309e printf: (allegedly) fix testsuite failure
Signed-off-by: Colin Watson <cjwatson@ubuntu.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-06-27 00:07:23 +02:00
Denys Vlasenko
d30b89c7ee updates for supporting Linux kernel build and initrd utilities
cpio: --verbose, --quiet, --to-stdout
test: make 64-bit math enable-able for hush too
dnsdomainname: alias to hostname -d
hostname: support --fqdn, --domain, --file

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-06-26 01:55:45 +02:00
Denys Vlasenko
f3b92d3856 getopt: FEATURE_GETOPT_LONG for -l; rename GETOPT_LONG to LONG_OPTS
Signed-off-by: Colin Watson <cjwatson@ubuntu.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-06-19 12:10:38 +02:00
Denys Vlasenko
bf4aeed129 printf: fix exit code on conversion error
Signed-off-by: Colin Watson <cjwatson@ubuntu.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-06-18 22:22:04 +02:00
Denys Vlasenko
14f6f0ad4a fsync: new applet by Pekka Pessi (Pekka.Pessi AT nokia.com)
function                                             old     new   delta
fsync_main                                             -     128    +128
fdatasync                                              -      39     +39
packed_usage                                       26596   26622     +26
applet_names                                        2098    2104      +6
applet_main                                         1240    1244      +4
applet_nameofs                                       620     622      +2
applet_install_loc                                   155     156      +1
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 5/0 up/down: 206/0)             Total: 206 bytes

Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-06-18 08:20:02 +02:00
Denys Vlasenko
1f363a0867 install: compat fix for mode of created files.
By Mat Hostetter (mhostetter AT tilera.com)

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-06-15 18:13:51 +02:00
Denys Vlasenko
9517d8ad72 seq: fix input handling in non-C locales
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-06-15 15:47:58 +02:00
Denys Vlasenko
4813a5100d libbb: stop using bb_strtod for now
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-06-15 09:50:54 +02:00
Denys Vlasenko
cd3dd42c28 seq: fix testsuite failures
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-06-15 09:16:27 +02:00
Denys Vlasenko
82a6fb3ea6 ash: fix . builtin
Also, move [[ ]] comment to test.c and expand it

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-06-14 19:42:12 +02:00
Denys Vlasenko
16635cc2e0 test, tcpsvd, tcpsvd: shrink
function                                             old     new   delta
nexpr                                                825     826      +1
tcpudpsvd_main                                      1830    1822      -8
test_main                                            257     247     -10
binop                                                584     525     -59
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/3 up/down: 1/-77)             Total: -76 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-06-13 22:49:08 +02:00
Denys Vlasenko
a99aa6e9c4 readlink: support -n, -v, -s and -q too if support for -f is requested
function                                             old     new   delta
readlink_main                                        104     135     +31
packed_usage                                       26322   26321      -1
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 31/-1)              Total: 30 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-06-12 13:16:21 +02:00
Denys Vlasenko
71016baf55 printf: accept negative numbers for %x; sh: overflowed numbers are 0
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-06-05 16:24:29 +02:00
Denis Vlasenko
f9d4fc3cf8 switch_root: improve behavior on error; improve help text
*: make "can't execute '%s'" message uniform
2009-04-21 20:40:51 +00:00
Denis Vlasenko
5e34ff29bc *: mass renaming of USE_XXXX to IF_XXXX
and SKIP_XXXX to IF_NOT_XXXX - the second one was especially
badly named. It was not skipping anything!
2009-04-21 11:09:40 +00:00
Denis Vlasenko
c7cc5a9432 mdev: Rob's #if forest removal
*: remove superfluous conts in "f(type *const param)"
2009-04-19 01:27:20 +00:00
Denis Vlasenko
f81e8dbc74 *: make "pragma GCC visibility push(hidden)" less ugly 2009-04-09 12:35:13 +00:00
Denis Vlasenko
df6f95cedf FEATURE_FANCY_ECHO needs to be accessible for hush 2009-04-07 20:07:23 +00:00
Denis Vlasenko
4d3a812b71 ls: warning fix
rm: accept and ignore -v (verbose)
2009-03-27 17:22:00 +00:00
Denis Vlasenko
3603cd2808 tail: fix tail +N syntax not working. Closes bug 221. 2009-03-27 02:36:02 +00:00
Denis Vlasenko
3a014b85dc ls: make readlink error to not disrupt output (try ls -l /proc/self/fd).
libbb: make xmalloc_readlink_or_warn warning more specific.

function                                             old     new   delta
xmalloc_readlink_or_warn                              33      61     +28
showfiles                                           1495    1460     -35
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 28/-35)             Total: -7 bytes
2009-03-21 19:11:23 +00:00
Denis Vlasenko
0b28103cc7 cd: "support" -v by ignoring it 2009-03-20 14:04:00 +00:00
Denis Vlasenko
0354aba9a1 df: fix FEATURE_DF_FANCY=off, FEATURE_HUMAN_READABLE=on case. 2009-03-19 03:56:20 +00:00
Denis Vlasenko
c1969f69b1 ls: make color-related code more readable. Fix a case when
it was working non-deterministically.

function                                             old     new   delta
bold                                                   -      34     +34
showfiles                                           1508    1495     -13
fgcolor                                               50      34     -16
bgcolor                                               34       -     -34
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 0/2 up/down: 34/-63)            Total: -29 bytes
2009-03-18 22:39:34 +00:00
Denis Vlasenko
9210a36495 tr: support -C as synonym to -c 2009-03-15 16:41:55 +00:00
Denis Vlasenko
7241e6d377 uname: correct cut/paste error
touch: add long options

function                                             old     new   delta
static.longopts                                      137     162     +25
touch_main                                           221     231     +10
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 35/0)               Total: 35 bytes
2009-03-15 01:28:30 +00:00
Denis Vlasenko
447ab18cf6 uname: support long options 2009-03-14 18:41:19 +00:00
Denis Vlasenko
245f91b649 ftpd + ls - timestamp = confused Mozilla. Prevent that. 2009-03-09 22:37:23 +00:00
Denis Vlasenko
1a6adbd71b uniq: strncmp(a,b, -1) might be problematic, use INT_MAX instead 2009-03-09 16:43:28 +00:00
Denis Vlasenko
c41cba5a57 ftpd: reuse ls applet for LIST/NLST/STAT generation
function                                             old     new   delta
popen_ls                                               -     211    +211
ftpd_main                                           1760    1826     +66
handle_dir_common                                    199     228     +29
get_remote_transfer_fd                                89     104     +15
replace_char                                          30      34      +4
handle_upload_common                                 263     265      +2
bind_for_passive_mode                                129     121      -8
cmdio_write                                           84      62     -22
escape_text                                          166     136     -30
init_data_sock_params                                 81       -     -81
ftpdataio_dispose_transfer_fd                         87       -     -87
write_dirstats                                       149       -    -149
write_filestats                                      603       -    -603
------------------------------------------------------------------------------
(add/remove: 1/4 grow/shrink: 11/5 up/down: 384/-986)        Total: -602 bytes
   text    data     bss     dec     hex filename
 808804     476    7864  817144   c77f8 busybox_old
 808156     476    7864  816496   c7570 busybox_unstripped
2009-03-09 15:46:07 +00:00
Denis Vlasenko
5e4fda0aff ftpd: code chrink, fixed some minor bugs
ls: update comment
*: openlog fixes (added LOG_PID, set LOG_DAEMON as appropriate)

function                                             old     new   delta
xwrite_str                                             -      26     +26
cmdio_write_ok                                         -      15     +15
handle_cwd                                            40      45      +5
packed_usage                                       25668   25670      +2
cmdio_write_raw                                        7       9      +2
handle_upload_common                                 322     320      -2
udhcpd_main                                         1375    1372      -3
udhcpc_main                                         2362    2359      -3
port_cleanup                                          27      23      -4
handle_dir_common                                    221     209     -12
str_netfd_write                                       26       -     -26
cmdio_get_cmd_and_arg                                122       -    -122
ftpd_main                                           2208    2050    -158
------------------------------------------------------------------------------
   text    data     bss     dec     hex filename
 809933     476    7864  818273   c7c61 busybox_old
 809199     476    7864  817539   c7983 busybox_unstripped
2009-03-08 23:46:48 +00:00
Denis Vlasenko
230997bd61 expr: a bit more robust handling of regexps with groups (closes bug 87) 2009-03-03 14:27:36 +00:00
Denis Vlasenko
6852effbc2 printf: fix 1.12.0 breakage (from %*d fix). It was misinterpreting "*" 2009-03-03 14:14:44 +00:00
Denis Vlasenko
248ce91017 ls: implement -Q and -g (-g was accepted but ignored)
function                                             old     new   delta
print_name                                             -     198    +198
showfiles                                           1489    1508     +19
ls_options                                            30      31      +1
opt_flags                                            112     108      -4
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 2/1 up/down: 218/-4)            Total: 214 bytes
2009-03-03 14:09:04 +00:00
Denis Vlasenko
11a6f9b44f ls: do not follow links with -s (closes bug 33),
display unsigned data with %XXu, not %XXd.
2009-03-03 13:20:22 +00:00
Denis Vlasenko
491d6e3b56 tr: fix overflow in expand and complement, fix stop after [:class:],
fix order of [:xdigit:], make tr require one param at least.

function                                             old     new   delta
expand                                              1743    1849    +106
tr_main                                              463     518     +55
complement                                            72      75      +3
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/0 up/down: 164/0)             Total: 164 bytes
2009-03-02 12:05:57 +00:00
Denis Vlasenko
1bfcc8b08e tr: support [:xdigit:], fix handling of ranges and [x]'s.
add testsuite entry for each of 3 bugs fixed.

function                                             old     new   delta      
static.classes                                        73      82      +9      
expand                                              1738    1743      +5      
complement                                            74      72      -2      
tr_main                                              472     463      -9      
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/2 up/down: 14/-11)              Total: 3 bytes
2009-03-01 04:50:18 +00:00
Bernhard Reutner-Fischer
bb5f8eddc4 - cosmetic typo in helptext 2009-02-14 12:13:13 +00:00
Denis Vlasenko
038eec7c8b uname: use wider integer for option bits 2009-01-19 16:38:30 +00:00
Denis Vlasenko
059138fd08 uname: add support for -i and -o, fix printing of unknown -p
value with -a option

function                                             old     new   delta
uname_main                                           166     185     +19
utsname_offset                                        12      16      +4
options                                              621     623      +2
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/0 up/down: 25/0)               Total: 25 bytes
2009-01-19 16:32:23 +00:00
Denis Vlasenko
cb39a7ca6d printf: make integer format strings print long long-sized values.
function                                             old     new   delta
printf_main                                          668     834    +166
bb_strtoll                                             -      84     +84
print_direc                                          391     431     +40
conv_strtoull                                          -      19     +19
conv_strtoll                                           -      19     +19
conv_strtoul                                          16       -     -16
conv_strtol                                           16       -     -16
------------------------------------------------------------------------------
(add/remove: 4/2 grow/shrink: 2/0 up/down: 342/-32)           Total: 296 bytes
2009-01-04 02:58:58 +00:00
Denis Vlasenko
e40e76f3cd unexpand: fix incorrect expansion, add test for it
function                                             old     new   delta
expand_main                                          676     656     -20
2008-12-26 14:56:03 +00:00
Denis Vlasenko
4e12b1a2a9 libbb: introduce and use xmalloc_ttyname (-32 in bss).
ash: small code shrink

   text    data     bss     dec     hex filename
 793669     504    7524  801697   c3ba1 busybox_old
 793659     504    7492  801655   c3b77 busybox_unstripped
2008-12-23 23:36:47 +00:00
Denis Vlasenko
3139ea7f15 expand: fix incorrect expansion exactly on tab boundary; shrink the code
function                                             old     new   delta
expand_main                                          698     676     -22
xputchar                                              53       -     -53
2008-12-14 15:45:25 +00:00
Denis Vlasenko
311c19a661 ash: printf builtin with no arguments should not exit 2008-12-10 11:51:45 +00:00
Denis Vlasenko
db12d1d733 Fix forgotten license comments 2008-12-07 00:52:58 +00:00
Denis Vlasenko
d7a805efaf libbb: introduce and use xgetpwnam. ~ -150 bytes. 2008-12-03 19:05:55 +00:00
Denis Vlasenko
0c68a874e7 libbb: password/group function helpers rewritten by Tito:
function                                             old     new   delta
xgetpwuid                                              -      27     +27
uid2uname_utoa                                         -      22     +22
gid2group_utoa                                         -      22     +22
uid2uname                                              -      18     +18
gid2group                                              -      18     +18
buffer_fill_and_print                                179     196     +17
print_user                                            12      24     +12
print_group                                           12      24     +12
get_cached                                            89      99     +10
...
print_common                                         134     120     -14
vlock_main                                           415     396     -19
logger_main                                          410     387     -23
crontab_main                                         642     609     -33
bb_getpwuid                                           42       -     -42
bb_getgrgid                                           42       -     -42
bb_getug                                              80       -     -80
------------------------------------------------------------------------------
(add/remove: 6/3 grow/shrink: 9/11 up/down: 187/-296)        Total: -109 bytes
2008-12-02 22:56:59 +00:00
Denis Vlasenko
9e0a7c9c41 remove a few superfluous includes 2008-11-25 13:33:11 +00:00
Denis Vlasenko
61befda93b ash,hush: add TODO for rare build failure
*: remove some redundant includes
2008-11-25 01:36:03 +00:00
Denis Vlasenko
de7a52fff2 id: do not abort build if we use internal password/group functions. 2008-11-17 00:12:17 +00:00
Denis Vlasenko
5ff1265691 id: abort the build of uclibc is less than 0.9.30 2008-11-16 15:03:11 +00:00
Denis Vlasenko
86c285d900 stat: fix compile breakage (get_f_fsid() is used even if !FEATURE_STAT_FORMAT) 2008-11-13 21:53:32 +00:00
Denis Vlasenko
7753ea49bd seq: shrink by 10 bytes 2008-11-12 21:37:19 +00:00
Bernhard Reutner-Fischer
c021cb08b5 - add support for seq -s <separator> 2008-11-12 13:22:24 +00:00
Bernhard Reutner-Fischer
2598f761bb - add seq -w support (Natanael Copa) 2008-11-12 12:59:56 +00:00
Denis Vlasenko
f91f14d221 cksum, printenv: report errors via exitcode
function                                             old     new   delta
cksum_main                                           296     315     +19
printenv_main                                         74      86     +12
2008-11-11 22:59:41 +00:00
Denis Vlasenko
0d8736772d head: report file open errors with exitcode 1 (was happily returning 0)
head_main                                            409     417      +8
2008-11-11 22:43:10 +00:00
Denis Vlasenko
272710fe93 expr: on error, exit with exitcode 2
expr_main                                            101     110      +9
2008-11-11 22:36:58 +00:00
Denis Vlasenko
98f5cdfca7 stat: make stat -f show filesystem "ID:" as coreutils does
print_statfs                                         358     370     +12
2008-11-11 22:25:34 +00:00
Denis Vlasenko
f3c2d13602 env: support -uVAR=VAL
function                                             old     new   delta
env_main                                             245     233     -12
2008-11-11 21:32:39 +00:00
Denis Vlasenko
618a3027ed du: fix "du /dir /dir" case
reset_ino_dev_hashtable                                -      84     +84
du                                                   388     376     -12
du_main                                              327     301     -26
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/2 up/down: 84/-38)             Total: 46 bytes
2008-11-11 21:15:56 +00:00
Denis Vlasenko
2211d5268c libbb: add optionl support for SHA256/512 encrypted passwords
function                                             old     new   delta
sha_crypt                                              -    2423   +2423
cryptpw_main                                         128     183     +55
to64                                                   -      29     +29
pw_encrypt                                           974    1000     +26
str_rounds                                             -      11     +11
login_main                                          1532    1541      +9
packed_usage                                       25215   25200     -15
__md5_to64                                            29       -     -29
------------------------------------------------------------------------------
(add/remove: 3/1 grow/shrink: 3/1 up/down: 2553/-44)         Total: 2509 bytes
2008-11-10 18:52:35 +00:00
Denis Vlasenko
56dceb9b77 sha256,sha512: new applets. +4.9kb
we will require sha256/512 code for new $5$ and $6$ style
 password hashes anyway, they are showing up already
 in people's /etc/passwd...
2008-11-10 13:32:50 +00:00
Denis Vlasenko
70e8f49f71 basename: fix error code. again. deja vu feeling... 2008-11-06 15:13:33 +00:00
Bernhard Reutner-Fischer
a643816fe3 - commentary typo fix (tito) 2008-11-05 08:18:16 +00:00
Bernhard Reutner-Fischer
6559100021 - fix typo in print_user() (tito) 2008-11-05 08:15:13 +00:00
Denis Vlasenko
e7368f16fa id: better wording in comments, no code changes 2008-10-29 10:30:54 +00:00
Denis Vlasenko
34e68c8b42 id: coreutils compat by Tito + test script 2008-10-29 00:27:31 +00:00
Denis Vlasenko
b730474bda ash: fix NOEXEC mode - we were forgetting to pass environment!
env: promote to NOEXEC
hd: promote to NOEXEC, as hexdump is NOEXEC already
2008-10-20 08:15:51 +00:00
Bernhard Reutner-Fischer
6c4dadefb6 - update my name. No obj-code changes ;) 2008-09-25 12:13:34 +00:00
Denis Vlasenko
e0bcba18eb df: unsigned long needs %lu 2008-09-25 10:41:15 +00:00
Denis Vlasenko
2228426512 id: fix "id <user>" case. Requires getgrouplist().
function                                             old     new   delta
getgrouplist_internal                                  -     200    +200
id_main                                              462     539     +77
bb_internal_getgrouplist                               -      67     +67
bb__parsespent                                       119     117      -2
bb_internal_initgroups                               213      58    -155
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 1/2 up/down: 344/-157)          Total: 187 bytes
2008-09-18 00:56:24 +00:00
Denis Vlasenko
53f219ebbe setfont: support -m and -C, support -m TEXTUAL_MAP (by Vladimir)
build system: fixlet for echo applet config

function                                             old     new   delta
setfont_main                                         157     387    +230
ctoi                                                   -      75     +75
packed_usage                                       24921   24950     +29
2008-09-16 19:35:42 +00:00
Denis Vlasenko
0d602e9386 id: unsigned long is excessive for option bitmask 2008-09-14 19:31:36 +00:00
Denis Vlasenko
4f3209b9d4 id: code shrink
function                                             old     new   delta
id_main                                              494     462     -32
2008-09-13 12:51:10 +00:00
Bernhard Reutner-Fischer
0ee1cb0084 - implement id -G (Tito Ragusa) 2008-09-12 09:58:11 +00:00
Denis Vlasenko
9f9c1935fa install: shrink -D code. By Bernhard.
function                                             old     new   delta
install_main                                         726     707     -19
2008-09-06 14:35:08 +00:00
Denis Vlasenko
d4b719878f kbd_mode: fix non-ASCII letters in comments
install: support -D
2008-09-03 21:54:46 +00:00
Denis Vlasenko
66496d75a7 build system: echo and test features may be enabled
even if these applets are enabled as ash builtins only
testsuite: add some awk tests
2008-08-29 08:37:07 +00:00
Denis Vlasenko
d66aa3c701 df: add support for more options, add some coreutils 6.10 compat.
by Bernhard Reutner-Fischer

function                                             old     new   delta
df_main                                              664     795    +131
packed_usage                                       24812   24862     +50
make_human_readable_str                              213     262     +49
static.ignored_mounts                                  -       8      +8
static.unit_chars                                      -       7      +7
static.zero_and_units                                  6       -      -6
------------------------------------------------------------------------------
(add/remove: 2/1 grow/shrink: 3/0 up/down: 245/-6)            Total: 239 bytes
2008-08-28 22:42:52 +00:00
Denis Vlasenko
8f0e342803 cksum: respect CONFIG_LFS=y. Adds 36 bytes in this case. 2008-08-27 21:31:23 +00:00
Denis Vlasenko
8334db13c3 cut: fix buffer overflow (bug 4544). 2008-08-15 21:20:23 +00:00
Denis Vlasenko
c80191c1d9 install: fix long option not taking params (bug 4584) 2008-08-15 19:56:24 +00:00
Denis Vlasenko
20be63fe71 tr: fix yet another access past the end of a string (bug 4374) 2008-07-30 22:58:18 +00:00
Denis Vlasenko
043d15da31 tr: fix "tr [=" case. Closes bug 4374.
function                                             old     new   delta
expand                                              1701    1738     +37
tr_main                                              472     474      +2
2008-07-28 23:49:42 +00:00
Denis Vlasenko
5e40070d38 tr: fix "access past the end of a string" bug 4354 2008-07-26 19:34:00 +00:00
Denis Vlasenko
6a0ad25061 ash: dont allow e.g. exec <&10 to attach to stript's fd!
function                                             old     new   delta
is_hidden_fd                                           -      61     +61
redirect                                            1135    1164     +29
popstring                                            134     140      +6
printf_main                                          635     637      +2
evalvar                                             1374    1376      +2
echo_main                                            294     296      +2
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 5/0 up/down: 102/0)             Total: 102 bytes
2008-07-25 13:34:05 +00:00
Denis Vlasenko
0f293b96dc fix all cases of strcpy on overlapping strings. 2008-07-22 20:16:55 +00:00
Bernhard Reutner-Fischer
3e8669f359 - wrap overlong lines (Cristian Ionescu-Idbohrn)
- s/\.  /. /g;# (me)
2008-07-22 18:27:53 +00:00
Denis Vlasenko
08d120e6e1 chown: do not use static data
function                                             old     new   delta
chown_main                                           160     182     +22
fileAction                                           750     744      -6
ugid                                                   8       -      -8
2008-07-22 11:37:23 +00:00
Denis Vlasenko
9e3a540b1b cut: stop using static data. This alone removed ~70 bytes of code.
+ some optimizations

function                                             old     new   delta
nlists                                                 4       -      -4
cut_lists                                              4       -      -4
cut_main                                            1041     960     -81
2008-07-22 10:34:46 +00:00
Denis Vlasenko
a5254032f5 cal: remove lone static data variable. -4 bytes. coreutils
is down to four applets with nonzero data+bss.
2008-07-22 10:10:13 +00:00
Denis Vlasenko
5415c856ea libbb: [x]fopen_for_{read,write} introduced and used.
(by Valdimir)

function                                             old     new   delta
config_open2                                           -      41     +41
config_read                                          507     542     +35
find_pair                                            169     187     +18
fopen_for_write                                        -      14     +14
fopen_for_read                                         -      14     +14
find_main                                            406     418     +12
xfopen_for_write                                       -      10     +10
xfopen_for_read                                        -      10     +10
popstring                                            134     140      +6
parse_inittab                                        396     401      +5
next_token                                           923     928      +5
pack_gzip                                           1659    1661      +2
bb__parsespent                                       117     119      +2
fallbackSort                                        1719    1717      -2
evalvar                                             1376    1374      -2
qrealloc                                              36      33      -3
...
...
...
...
singlemount                                         4579    4569     -10
process_stdin                                        443     433     -10
patch_main                                          1111    1101     -10
ifupdown_main                                       2175    2165     -10
file_action_grep                                      90      80     -10
uuidcache_init                                       649     637     -12
hush_main                                            797     785     -12
read_config                                          230     217     -13
dpkg_main                                           3835    3820     -15
read_line_input                                     3134    3110     -24
sysctl_main                                          232     203     -29
config_open                                           40      10     -30
WARN_BAD_LINE                                         44       -     -44
login_main                                          1714    1575    -139
------------------------------------------------------------------------------
(add/remove: 5/1 grow/shrink: 8/74 up/down: 174/-737)        Total: -563 bytes
2008-07-21 23:05:26 +00:00
Bernhard Reutner-Fischer
d73cbd31a2 - first pass to unify/cleanup uid handling (-236b)
This needs further love, alot of love.. Tito?
2008-07-21 14:41:33 +00:00
Denis Vlasenko
bd28f6bf7f test: fix parser to prefer binop over unop, as coreutils does.
remove bogus workaround in main(). rename atrocious variables/functions.
 much expand testsuite.
libbb: fix --help to not affect "test --help"

function                                             old     new   delta
run_applet_no_and_exit                               421     440     +19
nexpr                                                817     825      +8
static.no_op                                           -       6      +6
test_main                                            397     257    -140
------------------------------------------------------------------------------
(add/remove: 2/1 grow/shrink: 2/1 up/down: 104/-211)         Total: -107 bytes
2008-07-19 08:15:13 +00:00
Denis Vlasenko
5f116629d8 printf: do not print garbage on "%Ld". closes bug 4214.
function                                             old     new   delta
printf_main                                          633     637      +4
multiconvert                                          99      79     -20
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 4/-20)             Total: -16 bytes
2008-07-18 18:41:55 +00:00
Denis Vlasenko
a48656b441 printf: fix %b, fix several bugs in %*.*, fix compat issues with
aborting too early, support %zd; expand testsuite

function                                             old     new   delta
get_width_prec                                         -      46     +46
multiconvert                                          82      99     +17
conv_strtod                                           44      54     +10
print_direc                                          382     391      +9
printf_main                                          629     633      +4
conv_strtoul                                          20      16      -4
conv_strtol                                           20      16      -4
my_xstrtoul                                           20       -     -20
my_xstrtol                                            20       -     -20
my_xstrtod                                            21       -     -21
------------------------------------------------------------------------------
(add/remove: 1/3 grow/shrink: 4/2 up/down: 86/-69)             Total: 17 bytes
2008-07-18 11:10:51 +00:00
Denis Vlasenko
0f683f818c printf: protect against bogus format specifiers. Hopefully closes bug 4184 2008-07-17 09:17:51 +00:00
Denis Vlasenko
d6817f5d8b install: do not chown intermediate directories with install -d; shrink
(by Natanael Copa)

function                                             old     new   delta
.rodata                                           171528  171511     -17
install_main                                         841     697    -144
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-161)           Total: -161 bytes
2008-07-16 21:49:02 +00:00
Denis Vlasenko
55f7912dda libbb: get rid of statics in dump.c; code shrinks a lot too
function                                             old     new   delta
alloc_dumper                                           -      26     +26
hexdump_main                                         600     601      +1
static.done                                            1       -      -1
static.ateof                                           1       -      -1
bb_dump_vflag                                          1       -      -1
static.savp                                            4       -      -4
static.nextfs                                          4       -      -4
static.curp                                            4       -      -4
exitval                                                4       -      -4
endfu                                                  4       -      -4
bb_dump_length                                         4       -      -4
bb_dump_fshead                                         4       -      -4
bb_dump_blocksize                                      4       -      -4
_argv                                                  4       -      -4
bb_dump_add                                          365     358      -7
savaddress                                             8       -      -8
eaddress                                               8       -      -8
bb_dump_skip                                           8       -      -8
address                                                8       -      -8
bb_dump_dump                                        2748    2672     -76
next                                                 538     445     -93
------------------------------------------------------------------------------
(add/remove: 1/16 grow/shrink: 1/3 up/down: 27/-247)         Total: -220 bytes
   text	   data	    bss	    dec	    hex	filename
 789458	    607	   6764	 796829	  c289d	busybox_old
 789309	    601	   6696	 796606	  c27be	busybox_unstripped
2008-07-16 11:00:16 +00:00