Commit Graph

1110 Commits

Author SHA1 Message Date
Denis Vlasenko
501bfe2630 stat: fix option -Z segv (bug 1454) 2007-08-09 08:10:13 +00:00
Denis Vlasenko
8e209c3787 catv: catv without arguments was trying to use environ as argv.
(Alex Landau <landau_alex@yahoo.com>)
2007-08-06 12:28:24 +00:00
Denis Vlasenko
e013475830 env: micro-optimization
printenv: fix "printenv VAR1 VAR2" bug (wasn't printing VAR2)
(spotted by kalyanatejaswi balabhadrapatruni <kalyanatejaswi@yahoo.co.in>)

env_main                                             267     260      -7
printenv_main                                        147      75     -72
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-79)             Total: -79 bytes
   text    data     bss     dec     hex filename
 770336    1096   11228  782660   bf144 busybox_old
 770256    1096   11228  782580   bf0f4 busybox_unstripped
2007-08-06 02:55:41 +00:00
Denis Vlasenko
980864de08 dd: use unsigned printf specifier for # of blocks 2007-07-30 10:58:09 +00:00
Denis Vlasenko
2b03e5ef31 dd: fix newly introduced bug (introduced by me) 2007-07-29 14:59:06 +00:00
Denis Vlasenko
f868963c67 multiplier suffixes are short, store them directly in struct suffix_mult
function                                             old     new   delta
xstrtoul_range_sfx                                   226     217      -9
xstrtoull_range_sfx                                  291     280     -11
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-20)             Total: -20 bytes
   text    data     bss     dec     hex filename
 669128    2668   13616  685412   a7564 busybox_old
 669108    2668   13616  685392   a7550 busybox_unstripped
2007-07-27 15:06:25 +00:00
Denis Vlasenko
7587870617 dd: fix bug where we assume count=INT_MAX when count is unspecified;
shrink dd while at it

function                                             old     new   delta
dd_main                                             1453    1368     -85
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-85)             Total: -85 bytes
   text    data     bss     dec     hex filename
 669216    2668   13616  685500   a75bc busybox_old
 669128    2668   13616  685412   a7564 busybox_unstripped
2007-07-27 15:02:00 +00:00
Denis Vlasenko
3734b946bf bb_getpwuid, bb_getgrgid: change order of arguments to more intuitive one;
comment thoroughly when they die and when they dont.
2007-07-27 11:20:10 +00:00
Denis Vlasenko
661f6fad77 cal: small code shrink 2007-07-26 11:12:51 +00:00
Denis Vlasenko
990d0f63ee Replace index_in_[sub]str_array with index_in_[sub]strings,
which scans thru "abc\0def\0123\0\0" type strings. Saves 250 bytes.

   text    data     bss     dec     hex filename
 781266    1328   11844  794438   c1f46 busybox_old
 781010    1328   11844  794182   c1e46 busybox_unstripped
2007-07-24 15:54:42 +00:00
Denis Vlasenko
bcb66ec22e od: shrink a bit
verbose                                               12      13      +1
open_next_file                                       102      99      -3
limit_bytes_to_format                                  4       1      -3
ioerror                                                4       1      -3
flag_pseudo_start                                      4       1      -3
flag_dump_strings                                      4       1      -3
abbreviate_duplicate_blocks                            4       -      -4
check_and_close                                       96      90      -6
od_main                                             2988    2955     -33
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/7 up/down: 1/-58)             Total: -57 bytes
   text    data     bss     dec     hex filename
 781314    1328   11876  794518   c1f96 busybox_old
 781266    1328   11844  794438   c1f46 busybox_unstripped
2007-07-24 12:28:03 +00:00
Denis Vlasenko
bdc88fdc68 rework long option handling. saves ~1.2k
function                                             old     new   delta
tar_longopts                                           -     222    +222
static.udhcpc_longopts                                 -     192    +192
start_stop_daemon_longopts                             -     150    +150
getopt32                                            1045    1185    +140
static.wget_longopts                                   -     111    +111
static.od_longopts                                     -     105    +105
getopt_longopts                                        -      96     +96
install_longopts                                       -      67     +67
ipcalc_longopts                                        -      63     +63
static.hwclock_longopts                                -      54     +54
ftpgetput_longopts                                     -      52     +52
static.dumpleases_longopts                             -      32     +32
env_longopts                                           -      31     +31
runparts_longopts                                      -      30     +30
mv_longopts                                            -      24     +24
mkdir_longopts                                         -      19     +19
find_pair                                            164     180     +16
bb_null_long_options                                   -      16     +16
setconsole_longopts                                    -      10     +10
display_speed                                         91      98      +7
collect_blk                                          467     474      +7
show_color                                             4       1      -3
ls_main                                              913     904      -9
bb_default_long_options                               16       -     -16
ls_color_opt                                          32      10     -22
setconsole_long_options                               32       -     -32
arith                                               2077    2030     -47
mv_long_options                                       48       -     -48
mkdir_long_options                                    48       -     -48
env_long_options                                      48       -     -48
static.options                                       248     184     -64
runparts_long_options                                 80       -     -80
ftpgetput_long_options                                96       -     -96
static.hwclock_long_options                          112       -    -112
install_long_options                                 112       -    -112
static.long_options                                  144       -    -144
static.wget_long_options                             160       -    -160
longopts                                             160       -    -160
static.arg_options                                   304       -    -304
tar_long_options                                     320       -    -320
long_options                                         384       -    -384
------------------------------------------------------------------------------
(add/remove: 17/15 grow/shrink: 4/5 up/down: 1444/-2209)     Total: -765 bytes
   text    data     bss     dec     hex filename
 782618    1328   11900  795846   c24c6 busybox_old
 781354    1328   11900  794582   c1fd6 busybox_unstripped
2007-07-23 17:14:14 +00:00
Denis Vlasenko
b71c668c57 style fix (stray space before ';') 2007-07-21 15:08:09 +00:00
Denis Vlasenko
091965768d libbb: nuke BB_GETOPT_ERROR, always die if there are mutually exclusive options
find_pair                                            164     180     +16
passwd_main                                         1222    1230      +8
display_speed                                         91      96      +5
msh_main                                            1335    1339      +4
qrealloc                                              38      36      -2
refresh                                             1190    1182      -8
cut_main                                             543     532     -11
sendCgi                                             1807    1794     -13
getopt32                                            1063    1045     -18
arith                                               2077    2030     -47
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/6 up/down: 33/-99)            Total: -66 bytes
   text    data     bss     dec     hex filename
 781548    1168   11900  794616   c1ff8 busybox_old
 781452    1168   11900  794520   c1f98 busybox_unstripped
2007-07-21 13:27:44 +00:00
Denis Vlasenko
fb79a2e2cf xioctl and friends by Tito <farmatito@tiscali.it>
function                                             old     new   delta
do_iptunnel                                          203     977    +774
process_dev                                         5328    5494    +166
ioctl_or_perror                                        -      54     +54
ioctl_or_perror_and_die                                -      51     +51
ioctl_alt_func                                         -      49     +49
bb_ioctl_or_warn                                       -      47     +47
do_add_ioctl                                         102     145     +43
bb_xioctl                                              -      39     +39
print_value_on_off                                     -      31     +31
get_lcm                                              105     123     +18
arp_main                                            2155    2167     +12
..................
zcip_main                                           1576    1566     -10
setlogcons_main                                       92      82     -10
dumpkmap_main                                        263     253     -10
do_get_ioctl                                          85      75     -10
setkeycodes_main                                     165     154     -11
write_table                                          244     232     -12
vconfig_main                                         318     306     -12
do_del_ioctl                                          93      81     -12
set_address                                           75      62     -13
maybe_set_utc                                         30      16     -14
loadfont_main                                        495     479     -16
slattach_main                                        712     695     -17
do_loadfont                                          191     174     -17
do_iplink                                           1155    1136     -19
getty_main                                          2583    2562     -21
fbset_main                                          2058    2035     -23
do_time                                              588     565     -23
xioctl                                                25       -     -25
read_rtc                                             186     160     -26
parse_conf                                          1299    1270     -29
udhcp_read_interface                                 269     239     -30
bb_ioctl                                              45       -     -45
bb_ioctl_alt                                          70       -     -70
bb_ioctl_on_off                                       78       -     -78
.rodata                                           129370  129018    -352
do_show                                              799       -    -799
------------------------------------------------------------------------------
(add/remove: 6/5 grow/shrink: 13/49 up/down: 1316/-1864)     Total: -548 bytes
   text	   data	    bss	    dec	    hex	filename
 675352	   2740	  13968	 692060	  a8f5c	busybox_old
 674804	   2740	  13968	 691512	  a8d38	busybox_unstripped
2007-07-14 22:07:14 +00:00
Denis Vlasenko
d166f83d74 md5_sha1_sum: fix mishandling when run as /bin/md5sum (with path)
chown/chgrp: completely match coreutils 6.8 wrt symlink handling

function                                             old     new   delta
recursive_action                                     411     422     +11
arith                                               2033    2042      +9
collect_blk                                          467     474      +7
dhcprelay_main                                      1122    1125      +3
fsck_main                                           1909    1911      +2
singlemount                                         4555    4547      -8
xmalloc_realpath                                      14       -     -14
get_lcm                                              123     105     -18
ed_main                                             3111    3084     -27
chown_main                                           217     183     -34
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 5/4 up/down: 32/-101)           Total: -69 bytes
   text    data     bss     dec     hex filename
 684132    2744   14000  700876   ab1cc busybox_old
 684060    2744   14000  700804   ab184 busybox_unstripped
2007-07-05 00:12:55 +00:00
Denis Vlasenko
c6753c1666 expr: small code shrink 2007-07-01 18:33:35 +00:00
Denis Vlasenko
dc757aa16c introduce and use bb_basename()
function                                             old     new   delta
bb_basename                                            -      26     +26
sv_main                                             1226    1225      -1
passwd_main                                         1985    1983      -2
showdirs                                             482     478      -4
sendCgi                                             1811    1807      -4
make_device                                         1354    1350      -4
handleIncoming                                      2443    2439      -4
func_name                                             82      78      -4
service_name                                        2292    2285      -7
main                                                 909     901      -8
cmp_main                                             555     547      -8
test_main                                            434     422     -12
act                                                  228     216     -12
find_pair                                            180     164     -16
rmmod_main                                           298     280     -18
find_pid_by_name                                     156     134     -22
modprobe_main                                       1606    1576     -30
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/16 up/down: 26/-156)         Total: -130 bytes
   text    data     bss     dec     hex filename
 734933    3028   14400  752361   b7ae9 busybox_old
 734801    3028   14400  752229   b7a65 busybox_unstripped
2007-06-30 08:04:05 +00:00
Denis Vlasenko
e8240f19bd uuencode: shrink
function                                             old     new   delta
uuencode_main                                        427     337     -90
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-90)             Total: -90 bytes
   text    data     bss     dec     hex filename
 734981    3028   14400  752409   b7b19 busybox_old
 734889    3028   14400  752317   b7abd busybox_unstripped
2007-06-26 15:59:37 +00:00
Denis Vlasenko
80b8b39899 Consolidate ARRAY_SIZE macro; remove one unneeded global var (walter harms <wharms@bfs.de>) 2007-06-25 10:55:35 +00:00
Denis Vlasenko
88308fec80 test: suppress gcc warning
telnetd: do not use suferfluous static variable.
2007-06-25 10:35:11 +00:00
Denis Vlasenko
b304eadca8 test: shrink a bit
function                                             old     new   delta
test_main                                              5     434    +429
bb_test                                              473       -    -473
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/0 up/down: 429/-473)          Total: -44 bytes
   text    data     bss     dec     hex filename
 735073    3028   14408  752509   b7b7d busybox_old
 735029    3028   14408  752465   b7b51 busybox_unstripped
2007-06-21 13:35:52 +00:00
Denis Vlasenko
931de892cc random shrinkage of statics, -60 bytes saved 2007-06-21 12:43:45 +00:00
Denis Vlasenko
bb98db2ed2 echo: fix yet another buglet in non-fancy echo 2007-06-19 23:04:17 +00:00
Denis Vlasenko
a6163ca355 install: fix install a b /a/link/to/dir
install: fix -s (strip) option
nmeter: add TODO
2007-06-17 00:35:15 +00:00
Bernhard Reutner-Fischer
be99243945 - fix test -f ./exists
Note that test -f ./exists -a "-u" = "-u" doesn't work and did not work even before r18282, so this is a breakage not caused by me..
2007-06-15 10:36:49 +00:00
Bernhard Reutner-Fischer
fdcbc4e709 - fix testing primary expressions like '"-u" = "-u"' 2007-06-12 13:21:08 +00:00
Denis Vlasenko
16d58d75ee catv: was abusing xopen, should not die on err, but warn only. 2007-06-12 08:13:34 +00:00
Denis Vlasenko
cc5e090f12 move several applets to more correct ex-project. No code changes. 2007-06-12 08:12:33 +00:00
Denis Vlasenko
aa198dd39c uudecode: nuke duplicate base64_table[]. saves 65 bytes 2007-06-12 07:24:11 +00:00
Denis Vlasenko
a7c5d2c6d9 getopt_mk_fifo_nod: heed warning 2007-06-10 19:29:37 +00:00
Bernhard Reutner-Fischer
def8260219 - fix invocation without any argument 2007-06-08 12:52:17 +00:00
Denis Vlasenko
dc4ab54ea7 test: fix thinko in previous commit 2007-06-08 07:59:54 +00:00
Denis Vlasenko
89bca27158 test: recognize /path/to/[ case too 2007-06-08 07:33:45 +00:00
Bernhard Reutner-Fischer
1622cb8cea - i need this disabled code for testing a patch. Please leave it in. 2007-06-07 12:11:24 +00:00
Bernhard Reutner-Fischer
e8b2bd4d47 - fix wrong not operator which was essentially ignored. got introduced in r18282
http://busybox.net/lists/busybox/2007-June/027652.html
2007-06-06 19:27:58 +00:00
Denis Vlasenko
ae5a8aac26 awk: move all data to malloc space
function                                             old     new   delta
evaluate                                            6448    6728    +280
awk_getline                                          676     705     +29
parse_expr                                           726     752     +26
next_token                                           917     943     +26
next_input_file                                      237     252     +15
awk_split                                            498     510     +12
awk_sub                                              632     643     +11
split_f0                                             160     170     +10
getvar_s                                              98     108     +10
...
chain_loop                                           128     121      -7
nvalloc                                              179     171      -8
chain_node                                           107      99      -8
mainseq                                               12       -     -12
endseq                                                12       -     -12
chain_group                                          640     628     -12
beginseq                                              12       -     -12
awk_exit                                             112     100     -12
fsrealloc                                            127     110     -17
static.v                                              20       -     -20
static.rsm                                            24       -     -24
ttt                                                   28       -     -28
parse_program                                        339     311     -28
static.sreg                                           32       -     -32
intvar                                                76       -     -76
static.tspl                                           84       -     -84
rsplitter                                             84       -     -84
fsplitter                                             84       -     -84
------------------------------------------------------------------------------
(add/remove: 0/39 grow/shrink: 16/11 up/down: 439/-685)      Total: -246 bytes
2007-06-06 17:01:00 +00:00
Denis Vlasenko
c084d2f205 echo: fix non-fancy echo 2007-06-06 07:50:51 +00:00
Denis Vlasenko
746204b1b8 uudecode: fix to base64 decode by Jorgen Cederlof <jcz@google.com>
improved help texts

# make bloatcheck
function                                             old     new   delta
.rodata                                           127000  127032     +32
packed_usage                                       22156   22151      -5
uudecode_main                                        360     348     -12
uuencode_main                                        490     468     -22
read_base64                                          283     254     -29
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/4 up/down: 32/-68)            Total: -36 bytes
2007-06-04 23:32:35 +00:00
Denis Vlasenko
ef4bb26f93 diff: stop using data/bss
function                                             old     new   delta
do_diff                                              385     436     +51
diff_main                                            850     895     +45
dump_unified_vec                                     437     457     +20
prepare                                              335     334      -1
anychange                                              1       -      -1
suff                                                   4       -      -4
status                                               135     131      -4
static.max_context                                     4       -      -4
start                                                 12       8      -4
pref                                                   4       -      -4
member                                                 4       -      -4
label2                                                 4       -      -4
label1                                                 4       -      -4
klist                                                  4       -      -4
ixold                                                  4       -      -4
ixnew                                                  4       -      -4
dl_count                                               4       -      -4
dl                                                     4       -      -4
context_vec_start                                      4       -      -4
context_vec_ptr                                        4       -      -4
context_vec_end                                        4       -      -4
context                                                4       -      -4
clistlen                                               4       -      -4
clist                                                  4       -      -4
clen                                                   4       -      -4
class                                                  4       -      -4
J                                                      4       -      -4
add_to_dirlist                                        71      64      -7
slen                                                   8       -      -8
sfile                                                  8       -      -8
len                                                    8       -      -8
file                                                   8       -      -8
get_dir                                              196     185     -11
newcand                                               97      85     -12
change                                               351     331     -20
stb2                                                  96       -     -96
stb1                                                  96       -     -96
diffreg                                             2835    2717    -118
------------------------------------------------------------------------------
(add/remove: 0/27 grow/shrink: 3/8 up/down: 116/-482)        Total: -366 bytes

# size */*/diff.o
   text    data     bss     dec     hex filename
   7055       8     305    7368    1cc8 busybox.t2/coreutils/diff.o
   7002       0       0    7002    1b5a busybox.t3/coreutils/diff.o
2007-06-04 12:21:53 +00:00
Denis Vlasenko
74324c8666 Audit bb_common_bufsiz usage, add script which looks for misuse.
tr: stop using globals needlessly.
code: -103 bytes
2007-06-04 10:16:52 +00:00
Denis Vlasenko
9a7d38fe24 delete tons of extra #includes 2007-05-31 22:42:12 +00:00
Denis Vlasenko
fad2b86c9e use "glibc errno" trick not only for ash, but for entire busybox
(add/remove: 1/1 grow/shrink: 37/37 up/down: 139/-228)        Total: -89 bytes
2007-05-31 22:16:38 +00:00
Denis Vlasenko
4b924f3a5c whitespace fixes 2007-05-30 00:29:55 +00:00
Denis Vlasenko
fe3e1776ad test: close bug 1371
test: plug a memory leak
2007-05-27 03:39:50 +00:00
Denis Vlasenko
b6adbf1be2 usage.c: remove reference to busybox.h
*: s/include "busybox.h"/include "libbb.h"
2007-05-26 19:00:18 +00:00
Denis Vlasenko
6d709972cd cttyhack: new applet. 2007-05-18 09:45:36 +00:00
Denis Vlasenko
5b34083004 several *.c files:
move 'extern environ' up to the location of #includes
2007-05-17 23:02:14 +00:00
Denis Vlasenko
92c0b8222e tail: fix SEGV on "tail -N"
config system: clarify PREFER_APPLETS/SH_STANDALONE effects in help text
2007-05-08 17:27:17 +00:00
Denis Vlasenko
dcf4de20a1 test: code size saving, no logic changes
ps: fix warning, make a bit smaller
kill -l: make smaller & know much more signals

function                                             old     new   delta
get_signum                                           121     153     +32
kill_main                                            826     843     +17
get_signame                                           44      36      -8
signals                                              252     224     -28
.rodata                                           131955  131923     -32
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/3 up/down: 49/-68)            Total: -19 bytes
2007-05-01 20:07:29 +00:00