Commit Graph

555 Commits

Author SHA1 Message Date
Denys Vlasenko
0337e038a9 ash: randmconfig fix
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-29 00:12:30 +01:00
Denys Vlasenko
cd71683ae6 ash: remake strange signed char machinery to be unsigned. -57 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-28 22:14:02 +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
Denys Vlasenko
36df04837a randomconfig fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-19 16:07:28 +02:00
Denys Vlasenko
76ace254e1 ash,hush: fix $RANDOM in children being repeated
function                                             old     new   delta
next_random                                           46      68     +22
forkshell                                            248     263     +15
expand_vars_to_list                                 2118    2131     +13
run_pipe                                            1775    1782      +7
popstring                                            134     140      +6
builtin_umask                                        123     121      -2
ash_main                                            1356    1336     -20
get_local_var_value                                  125     104     -21
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 5/3 up/down: 63/-43)             Total: 20 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-12 15:25:01 +02:00
Denys Vlasenko
e7670ff81d ash: use bbox wrappers for malloc etc instead of homegrown ones
function                                             old     new   delta
popstring                                            134     140      +6
ckmalloc                                               9       -      -9
ckstrdup                                              22       -     -22
ckrealloc                                             24       -     -24
ckzalloc                                              28       -     -28
------------------------------------------------------------------------------
(add/remove: 0/4 grow/shrink: 1/0 up/down: 6/-83)             Total: -77 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-11 00:45:25 +02:00
Denys Vlasenko
0e5e4eaf7b ash: trivial shrink by using smaller int
function                                             old     new   delta
copynode                                             197     196      -1
calcsize                                             127     126      -1
nodesize                                              54      27     -27
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-29)             Total: -29 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-11 00:36:20 +02:00
Denys Vlasenko
3ea2e82dc7 ash: factor out $RANDOM support
function                                             old     new   delta
next_random                                            -      46     +46
ash_main                                            1361    1356      -5
change_random                                        132      97     -35
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/2 up/down: 46/-40)              Total: 6 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-09 20:59:04 +02:00
Denys Vlasenko
adf922ec28 *: a few more NOINLINEs
function                                             old     new   delta
print_linkinfo                                         -     815    +815
do_msg                                                 -     783    +783
INET_setroute                                          -     757    +757
varvalue                                               -     746    +746
do_sem                                                 -     637    +637
inflate_codes                                          -     617    +617
INET6_setroute                                         -     491    +491
edir                                                   -     370    +370
sync_cursor                                            -     298    +298
update_utmp                                            -     246    +246
searchLines                                            -     165    +165
setup_alarm                                            -     144    +144
may_wakeup                                             -     101    +101
getNum                                               566     371    -195
refresh                                             1166     848    -318
rtcwake_main                                         809     479    -330
getty_main                                          2396    1921    -475
chpst_main                                          1373     746    -627
inflate_unzip_internal                              1335     567    -768
evalvar                                             1384     612    -772
ipaddr_list_or_flush                                2160    1246    -914
route_main                                          1585     245   -1340
ipcs_main                                           2523    1049   -1474
------------------------------------------------------------------------------
(add/remove: 13/0 grow/shrink: 0/10 up/down: 6170/-7213)    Total: -1043 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-08 14:35:37 +02:00
Denys Vlasenko
57ce977a97 ash: compile breakage fix
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-08 04:19:14 +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
Cristian Ionescu-Idbohrn
301f5ecb8d ash: error out on ${#1#}, ${#$11}, ${#11#}
Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-05 02:07:23 +02:00
Denys Vlasenko
4d8873f997 ash: document where we accept invalid syntax. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-04 03:14:41 +02:00
Denys Vlasenko
76622dbd16 ash: code shrink
function                                             old     new   delta
ulimitcmd                                            489     415     -74

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-04 01:14:19 +02:00
Denys Vlasenko
c34c033c42 ash,hush: share string
function                                             old     new   delta
optschanged                                          133     139      +6
hush_main                                            997     982     -15
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 6/-15)              Total: -9 bytes
   text   data    bss    dec    hexfilename
 823160    445   7668 831273  caf29busybox_old
 823102    445   7668 831215  caeefbusybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-29 12:25:30 +02:00
Denys Vlasenko
db9c57eed1 libbb/lineedit: fix the case when we configured history to have 0 lines
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-27 02:48:53 +02:00
Denys Vlasenko
e74aaf9385 ash,hush: make trap output short signal names, without SIG prefix
function                                             old     new   delta
evalvar                                             1373    1371      -2
builtin_trap                                         457     441     -16
trapcmd                                              260     236     -24

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-27 02:05:45 +02:00
Denys Vlasenko
8f88d85e34 ash: better comment. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-25 12:12:53 +02:00
Denys Vlasenko
726e1a04f7 ash: even smaller trap code
function                                             old     new   delta
evalvar                                             1371    1373      +2
trapcmd                                              347     260     -87

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-25 02:58:20 +02:00
Denys Vlasenko
e305c28285 ash: slightly better (more correct) code for "trap hack"
function                                             old     new   delta
changepath                                           194     195      +1
evalvar                                             1373    1371      -2
forkchild                                            602     590     -12

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-25 02:12:27 +02:00
Denys Vlasenko
21d87d495a ash: better handling of EXIT trap in trap hack
function                                             old     new   delta
forkchild                                              -     602    +602
trapcmd                                              255     347     +92
ash_main                                            1362    1375     +13
evalvar                                             1371    1373      +2
popstring                                            140     134      -6
forkshell                                            835     248    -587
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 3/2 up/down: 709/-593)          Total: 116 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-25 00:06:51 +02:00
Denys Vlasenko
0800e3af75 ash: do not let EXIT trap to fire in trap
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-24 03:09:26 +02:00
Denys Vlasenko
2f7894b1bb ash,hush: fix trap reporting: s/SIGEXIT/EXIT/
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-24 01:43:21 +02:00
Denys Vlasenko
606291beab *: more portability fixes by Dan Fandrich
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-23 23:15:43 +02:00
Denys Vlasenko
1f27ab0d4b *: optimize code size in strtoul calls
function                                             old     new   delta
bb_parse_mode                                        433     431      -2
rtnl_rtntype_a2n                                     202     198      -4
ParseField                                           511     498     -13
bb_init_module_24                                   4730    4675     -55
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/4 up/down: 0/-74)             Total: -74 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-23 17:17:53 +02:00
Denys Vlasenko
844f990926 ash: fix trap
function                                             old     new   delta
forkshell                                            738     810     +72
popstring                                            134     140      +6
parse_command                                       1460    1463      +3
evalvar                                             1373    1371      -2
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/1 up/down: 81/-2)              Total: 79 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-23 03:25:52 +02:00
Denys Vlasenko
1166d7b136 ash: fix bug 585 (>"$VAR_WITH_UNICODE_CHARS" problem)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-16 16:20:31 +02:00
Denys Vlasenko
b0d63383dd ash: preparatory cleanup. The only real changes are (unsigned char) casts
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-16 16:18:32 +02:00
Denys Vlasenko
6db4784d27 hush: export PWD
function                                             old     new   delta
set_pwd_var                                            -      36     +36
hush_main                                            941     951     +10
evalvar                                             1365    1363      -2
ash_main                                            1364    1362      -2
builtin_cd                                            75      72      -3
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/3 up/down: 46/-7)              Total: 39 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-05 20:15:17 +02:00
Denys Vlasenko
a00329ca8e ash: better comment. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-08-30 20:05:10 +02:00
Denys Vlasenko
7218af9f83 ash: revent one place where number() doesn't work
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-08-30 17:07:30 +02:00
Denys Vlasenko
ecc2a2e015 ash: deal with some TODOs (mostly trivial)
function                                             old     new   delta
msg_illnum                                             -      19     +19
evalvar                                             1365    1364      -1
illnum                                                19       -     -19
subevalvar                                          1182    1158     -24
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 0/2 up/down: 19/-44)            Total: -25 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-08-29 22:53:41 +02:00
Denys Vlasenko
c8334a40c9 ash: fix handling of Unicode chars in redirects. Fixes bug 585
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-08-29 20:24:12 +02:00
Denys Vlasenko
b6c8434896 ash: trivial simplifications and optimizations
function                                             old     new   delta
rmescapes                                              -     256    +256
memtodest                                             94     103      +9
evalvar                                             1363    1365      +2
_rmescapes                                           256       -    -256
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 2/0 up/down: 267/-256)           Total: 11 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-08-29 20:23:20 +02:00
Denys Vlasenko
a12af2d9f3 ash: make "jobs -l" more similar to bash. By Earl Chew. Fixes bug 481
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-08-23 22:10:04 +02:00
Denys Vlasenko
ffc39202aa ash: fix bug 571 (jobs %string misbehaving)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-08-17 02:12:20 +02:00
Denys Vlasenko
7cee00e8ae ash: further fixes to debug machinery (closes bug 485)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-07-24 01:08:03 +02:00
Denys Vlasenko
e56f22ac60 ash: make "jobs" work even in subshells
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-07-24 00:16:59 +02:00
Denys Vlasenko
86e83ec487 ash: fix debug machinery a bit
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-07-23 22:07:07 +02:00
Denys Vlasenko
883cea4751 ash: fixes in debug printouts
Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-07-11 15:31:59 +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
641dd7b080 ash: revert over-zealous usage of FAST_FUNC
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-06-11 19:30:19 +02:00
Denys Vlasenko
77539190ab added comments about [[ ]] to ash and hush. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-06-10 14:09:48 +02:00
Denys Vlasenko
2634bf366b randomconfig fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-06-09 18:40:07 +02:00
Denys Vlasenko
d6b05eb9c2 hush: make builtins work in pipes (eval ... | ...) on NOMMU
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-06-06 20:59:55 +02:00
Denys Vlasenko
d5f1b1bbe0 *: add FAST_FUNC to function ptrs where it makes sense
function                                             old     new   delta
evalcommand                                         1195    1209     +14
testcmd                                                -      10     +10
printfcmd                                              -      10     +10
echocmd                                                -      10     +10
func_exec                                            270     276      +6
echo_dg                                              104     109      +5
store_nlmsg                                           85      89      +4
pseudo_exec_argv                                     195     198      +3
dotcmd                                               287     290      +3
machtime_stream                                       29      31      +2
discard_stream                                        24      26      +2
argstr                                              1299    1301      +2
killcmd                                              108     109      +1
evalfor                                              226     227      +1
daytime_stream                                        43      44      +1
run_list                                            2544    2543      -1
lookupvar                                             62      61      -1
ipaddr_modify                                       1310    1309      -1
...
parse_stream                                        2254    2245      -9
evalpipe                                             356     347      -9
collect_if                                           210     197     -13
read_opt                                             869     851     -18
handle_dollar                                        681     658     -23
print_addrinfo                                      1342    1303     -39
iterate_on_dir                                       156      59     -97
print_route                                         1709    1609    -100
------------------------------------------------------------------------------
(add/remove: 3/0 grow/shrink: 12/130 up/down: 74/-767)       Total: -693 bytes
   text    data     bss     dec     hex filename
 841748     467    7872  850087   cf8a7 busybox_old
 841061     467    7872  849400   cf5f8 busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-06-05 12:06:05 +02: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
eb85849b50 hush: deal with umask TODO (symbolic modes)
function                                             old     new   delta
builtin_umask                                         79     125     +46
2009-04-18 02:06:54 +00:00
Denis Vlasenko
135cecbbce ash: fix warning in debug build 2009-04-12 00:00:57 +00:00
Denis Vlasenko
34d4d89b2d hush: fix NOMMU hangs in pseudo_exec_argv. Add forgotted setting
of signal mask. Reuse same help string in all shells.

function                                             old     new   delta
builtin_exit                                          49      47      -2
pseudo_exec_argv                                     149     145      -4
builtin_help                                          74      63     -11
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-17)             Total: -17 bytes
   text    data     bss     dec     hex filename
 825379     476    7616  833471   cb7bf busybox_old
 825341     476    7616  833433   cb799 busybox_unstripped
2009-04-04 20:24:37 +00:00
Denis Vlasenko
b29eb6ed25 shells: do not need to have math state global
function                                             old     new   delta                           
ash_arith                                              -     143    +143                           
expand_variables                                    2102    2124     +22                           
popstring                                            134     140      +6                           
parse_command                                       1460    1463      +3                           
trapcmd                                              236     238      +2                           
changepath                                           197     196      -1                           
raise_interrupt                                       86      83      -3                           
hush_main                                           1012     991     -21                           
ash_main                                            1388    1364     -24                           
arith_set_local_var                                   73      34     -39                           
dash_arith                                           117       -    -117                           
------------------------------------------------------------------------------                     
(add/remove: 1/1 grow/shrink: 4/5 up/down: 176/-205)          Total: -29 bytes
2009-04-02 13:46:27 +00:00
Denis Vlasenko
0dfe1d26a9 fix ash-alias/alias.tests failure 2009-04-02 12:57:38 +00:00
Mike Frysinger
98c52645c0 split math code out of ash and into a standalone library so we can use it in any shell (like hush!) 2009-04-02 10:02:37 +00:00
Denis Vlasenko
551ffdccea more of pointless whitespace fixes 2009-04-01 19:48:05 +00:00
Denis Vlasenko
f6fbd62760 ash: add/improve comments, no code changes 2009-03-31 19:36:58 +00:00
Denis Vlasenko
46aeab9a34 ash: fix $IFS handling in read. closes bug 235 2009-03-31 19:18:17 +00:00
Denis Vlasenko
5368ad53e9 ash: expand comment 2009-03-20 10:20:08 +00:00
Denis Vlasenko
1bb3d7e450 ash: add missing comma in debug scaffolding 2009-03-20 07:45:36 +00:00
Denis Vlasenko
b9e70ddf2d ash: fix a case where we close wrong descriptor; add debug hack for that 2009-03-20 01:24:08 +00:00
Denis Vlasenko
f173395c4a ash: DEBUG should be 0 :) 2009-03-19 23:21:55 +00:00
Denis Vlasenko
b21f379639 ash: fix TRACE commands 2009-03-19 23:09:58 +00:00
Denis Vlasenko
653d8e79b2 ash: make evaltree save/restore int suppression depth.
Hopefully this fixes bug 189. Not confirmed by users yet.

function                                             old     new   delta
evaltree                                             809     842     +33
evalvar                                             1374    1376      +2
2009-03-19 21:59:35 +00:00
Denis Vlasenko
4b875708c1 ash: in dotrap(), do not clear gotsig[] for SIGINT if there is no handler
for it, otherwise raise interrupt gets confused later.
 The rest are readability fixes.

function                                             old     new   delta                                                                                                       
evaltreenr                                           817     818      +1                                                                                                       
evaltree                                             817     818      +1                                                                                                       
evalstring                                            88      89      +1                                                                                                       
cmdloop                                              420     419      -1                                                                                                       
evalskip                                               4       1      -3                                                                                                       
breakcmd                                              84      81      -3                                                                                                       
ash_main                                            1382    1379      -3                                                                                                       
evalloop                                             183     177      -6                                                                                                       
evalfor                                              231     225      -6                                                                                                       
------------------------------------------------------------------------------                                                                                                 
(add/remove: 0/0 grow/shrink: 3/6 up/down: 3/-22)             Total: -19 bytes
2009-03-19 13:30:04 +00:00
Denis Vlasenko
7f88e34e1a ash: tentatively fix bug 189. 2009-03-19 03:36:18 +00:00
Denis Vlasenko
5c2b81470d ash: fix "ash -c 'exec 1>&0'" complaining that fd 0 is busy 2009-03-19 01:59:59 +00:00
Denis Vlasenko
9604e1b8fc modprobe: emit "can't open 'modules.dep': (errno)" instead of "module not found"
*: s/can't open %s/can't open '%s'/, it's better to use same string.

function                                             old     new   delta
do_modprobe                                          588     601     +13
config_file_action                                   339     345      +6
modprobe_main                                        565     570      +5
unable_to_open                                        14      16      +2
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/0 up/down: 26/0)               Total: 26 bytes
   text    data     bss     dec     hex filename
 816800     476    7892  825168   c9750 busybox_old
 816812     476    7892  825180   c975c busybox_unstripped
2009-03-03 18:47:56 +00:00
Denis Vlasenko
8ad78e1ec7 ash: make dot command search current directory first, as bash does. 2009-02-15 12:40:30 +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
68819d1232 ash: fix CONFIG_ASH_OPTIMIZE_FOR_SIZE off + high-bit chars case
(do we even need CONFIG_ASH_OPTIMIZE_FOR_SIZE conditional?)
2008-12-15 11:26:36 +00:00
Denis Vlasenko
81c3a1d0b2 ash: remove TODO which seems to actually work now.
no code changes
2008-12-03 11:59:12 +00:00
Denis Vlasenko
f8535ccd65 ash: finally installed it as /bin/sh on my machine.
some breakage noticed, the most dire is mishandled ^C.
 fixing it.

function                                             old     new   delta
blocking_wait_with_raise_on_sig                        -      40     +40
waitforjob                                            85     100     +15
setsignal                                            280     278      -2
evalvar                                             1376    1374      -2
waitcmd                                              186     182      -4
dowait                                               350     316     -34
redirect                                            1231    1185     -46
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/5 up/down: 55/-88)            Total: -33 bytes
2008-12-03 10:36:26 +00:00
Denis Vlasenko
e27dafd338 ash: add FIXME 2008-11-28 04:01:03 +00:00
Denis Vlasenko
7b2294edff ash: "ash: syntax error: XXX unexpected" -> "ash: syntax error: unexpected XXX" 2008-11-28 03:50:46 +00:00
Denis Vlasenko
41eb300ff6 ash: shrink on top of previous change
function                                             old     new   delta
readtoken1                                          3201    3221     +20
xxreadtoken                                          306     313      +7
pungetc                                               13      12      -1
ash_main                                            1380    1379      -1
setinputfile                                         196     192      -4
plinno                                                 4       -      -4
parsenleft                                             4       -      -4
parsenextc                                             4       -      -4
parselleft                                             4       -      -4
setinputstring                                        67      62      -5
pushstring                                           123     114      -9
pgetc                                                455     438     -17
pushfile                                              69      31     -38
popfile                                              114      76     -38
------------------------------------------------------------------------------
(add/remove: 0/4 grow/shrink: 2/8 up/down: 27/-129)          Total: -102 bytes
   text    data     bss     dec     hex filename
 798750     564    7756  807070   c509e busybox_old
 798664     560    7748  806972   c503c busybox_unstripped
2008-11-28 03:42:31 +00:00
Denis Vlasenko
727752d2d2 ash: better fix for ash -c 'echo 5&' and ash -c 'sleep 5&'
with testcase
2008-11-28 03:41:47 +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
1689840672 ash: fix bad interaction between ash -c '....&' and bash compat 2008-11-25 01:34:52 +00:00
Denis Vlasenko
cc5feabeba ash: NTO2 needs #if ENABLE_ASH_BASH_COMPAT 2008-11-22 01:32:40 +00:00
Denis Vlasenko
340299a8bc ash: fix miscalculation of memory needed for eval tree
found by Timo Teras (timo.teras AT iki.fi)
2008-11-21 10:36:36 +00:00
Denis Vlasenko
be54d6bc60 ash: fix "while kill -0 $child; do true; done" looping forever. 2008-10-27 14:25:52 +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
Denis Vlasenko
834dee785d ash: support &> redirection (bashism). ~90 bytes of code 2008-10-07 09:18:30 +00:00
Denis Vlasenko
176d49d4f7 ash: some beautification work, no code changes 2008-10-06 09:51:47 +00:00
Denis Vlasenko
559691a3bf ash: implement ">&file" bashism. ~100 bytes. 2008-10-05 18:39:31 +00:00
Denis Vlasenko
d6855d1b50 style fixes, no code changes 2008-09-27 14:03:25 +00:00
Denis Vlasenko
34c73c499b ash: fix "(cat < file)" hang introduced by rev 22944. 2008-08-16 11:48:02 +00:00
Denis Vlasenko
c90e1be01b ash: bash compat: "shift $BIGNUM" is equivalent to "shift 1" 2008-07-30 15:35:05 +00:00
Denis Vlasenko
87d5fd984e ash: fix typo 2008-07-26 13:48:35 +00:00
Denis Vlasenko
4e19a9c81a ash: hopefully close bug 4324. With testcase.
function                                             old     new   delta
evaltree                                             621     869    +248
popstring                                            134     140      +6
2008-07-26 13:45:57 +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
22f7414843 ash: prevent exec NN>&- from closing fd used for script reading 2008-07-24 22:34:43 +00:00
Denis Vlasenko
5a867317bb ash: fix a bug where redirection fds were not closed afterwards.
optimize close+fcntl(DUPFD) into dup2. add testsuites.

function                                             old     new   delta
copyfd                                                47      68     +21
argstr                                              1311    1298     -13
popredir                                             148     131     -17
redirect                                            1139    1107     -32
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/3 up/down: 21/-62)            Total: -41 bytes
2008-07-24 19:46:38 +00:00
Denis Vlasenko
6fbb43bc3c ash: teach ash about 123>file. It could take only 0..9 before
function                                             old     new   delta
redirect                                            1052    1139     +87
need_to_remember                                       -      36     +36
popredir                                             132     148     +16
fixredir                                              86     101     +15
readtoken1                                          3130    3143     +13
evalvar                                             1374    1376      +2
popstring                                            140     134      -6
cmdtxt                                               592     561     -31
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 5/2 up/down: 169/-37)           Total: 132 bytes
2008-07-24 19:44:41 +00:00
Denis Vlasenko
6514c5e35c ash: ducument where "no fds > 9 in redirects" limitation is.
no code changes.
2008-07-24 13:41:37 +00:00
Denis Vlasenko
8d924ecf38 ash: ditch dupredirect(), it was only making code harder to read.
incorporate it in its single callsite.

function                                             old     new   delta
redirect                                            1054    1052      -2
changepath                                           196     194      -2
2008-07-24 11:34:27 +00:00
Denis Vlasenko
0b76964ae1 ash: explain redirect code a bit
function                                             old     new   delta
redirect                                            1059    1054      -5
2008-07-24 07:54:57 +00:00
Denis Vlasenko
2dc240c0d6 ash: code shrink
function                                             old     new   delta
copynode                                             171     180      +9
evaltreenr                                           615     621      +6
evaltree                                             615     621      +6
calcsize                                             121     127      +6
evalpipe                                             349     350      +1
redirect                                            1059    1057      -2
parseheredoc                                         129     126      -3
makename                                              35      32      -3
expredir                                             130     127      -3
parsefname                                           224     219      -5
popstring                                            140     134      -6
pipeline                                             276     268      -8
list                                                 360     351      -9
readtoken1                                          3157    3130     -27
parse_command                                       1504    1460     -44
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 5/10 up/down: 28/-110)          Total: -82 bytes
2008-07-24 06:07:50 +00:00
Bernhard Reutner-Fischer
a53de7f7c2 - fix spelling 2008-07-21 13:46:54 +00:00
Denis Vlasenko
3177ba0852 ash: small code shrink 2008-07-13 20:39:23 +00:00
Denis Vlasenko
e7067e38ea ash: fix segfault in "command -v" 2008-07-11 23:09:34 +00:00
Denis Vlasenko
a60f84ebf0 *: rename ATTRIBUTE_XXX to just XXX. 2008-07-05 09:18:54 +00:00
Denis Vlasenko
fa0b56db76 sendmail: fix wrong vfork usage here too
*: shorten error texts

function                                             old     new   delta
launch_helper                                          -     151    +151
vfork_or_die                                          20       -     -20
sendgetmail_main                                    1946    1848     -98
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 0/1 up/down: 151/-118)           Total: 33 bytes
2008-07-01 16:09:07 +00:00
Denis Vlasenko
ce13b76002 libbb: shrink monotonic_XXX functions, introduce monotonic_ns
(unused for now)

function                                             old     new   delta
get_mono                                               -      31     +31
sv_main                                             1228    1234      +6
expand                                              1693    1697      +4
get_address                                          178     181      +3
utoa_to_buf                                          108     110      +2
builtin_exit                                          46      48      +2
qrealloc                                              36      33      -3
qgravechar                                           109     106      -3
ash_main                                            1383    1380      -3
grep_file                                            850     846      -4
popstring                                            140     134      -6
monotonic_us                                          85      60     -25
monotonic_sec                                         41      16     -25
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 5/7 up/down: 48/-69)            Total: -21 bytes
2008-06-29 02:25:53 +00:00
Denis Vlasenko
26bc57d8b2 ash: improve comments 2008-06-27 00:29:34 +00:00
Denis Vlasenko
448d30ee17 ash: fix very weak $RANDOM generator; and move even more things
out of data/bss

   text    data     bss     dec     hex filename
 807935     611    6884  815430   c7146 busybox_old
 808035     611    6868  815514   c719a busybox_unstripped
2008-06-27 00:24:11 +00:00
Denis Vlasenko
843cbd54d1 ash: move stuff out of data/bss
text    data     bss     dec     hex filename
 807939     611    6900  815450   c715a busybox_old
 807935     611    6884  815430   c7146 busybox_unstripped
2008-06-27 00:23:18 +00:00
Denis Vlasenko
cc3f20b9bd fix breakage found by randomconfig 2008-06-23 22:31:52 +00:00
Denis Vlasenko
2f5d0cd511 ash: trivial code readability fixes 2008-06-23 13:24:19 +00:00
Denis Vlasenko
2b75a94118 ash: improve readability of the code. No real code changes. 2008-06-23 13:06:34 +00:00
Denis Vlasenko
ef527f50e6 ash: optional support for $'...\t...\n...' bashism
function                                             old     new   delta
readtoken1                                          2824    3172    +348
static.C_escapes                                       -      18     +18
parse_command                                       1504    1500      -4
SIT                                                   89      83      -6
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/2 up/down: 366/-10)           Total: 356 bytes
2008-06-23 01:52:30 +00:00
Denis Vlasenko
b07a496229 ash: minor shrink (mostly smallints) and variable renaming
function                                             old     new   delta
optschanged                                           85      91      +6
tryexec                                              115     118      +3
xxreadtoken                                          290     292      +2
raise_error_unexpected_syntax                         75      77      +2
bltincmd                                               6       8      +2
parseheredoc                                         128     129      +1
static.is_interactive                                  4       1      -3
readtoken                                            156     153      -3
lasttoken                                              4       1      -3
evalcommand                                         1147    1144      -3
checkkwd                                               4       1      -3
back_exitstatus                                        4       1      -3
pipeline                                             282     276      -6
list                                                 369     360      -9
ash_main                                            1402    1393      -9
options                                              616     606     -10
readtoken1                                          2823    2811     -12
parse_command                                       1529    1507     -22
------------------------------------------------------------------------------
(add/remove: 2/2 grow/shrink: 6/12 up/down: 21/-91)           Total: -70 bytes
   text    data     bss     dec     hex filename
 807603     611    6908  815122   c7012 busybox_old
 807545     611    6900  815056   c6fd0 busybox_unstripped
2008-06-22 13:16:23 +00:00
Denis Vlasenko
9cd4c76b50 ash: fix "shift BIGNUM" and "read with no variable name" bugs.
omg. hush testsuite helps to find bugs in ash! what next?

function                                             old     new   delta
static.arg_REPLY                                       -       8      +8
readcmd                                             1023    1021      -2
shiftcmd                                             129     125      -4
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/2 up/down: 8/-6)                Total: 2 bytes
2008-06-18 19:22:19 +00:00
Denis Vlasenko
29038c06d6 ash: small cosmetic change 2008-06-14 06:14:02 +00:00
Denis Vlasenko
2659c63213 ash: fix ${var/s/r} handling, add testcase. 2008-06-14 06:04:59 +00:00
Mike Frysinger
98a6f56d49 reword the error msg so people realize that they broke it, they buy it 2008-06-09 09:38:45 +00:00
Denis Vlasenko
cd2663f15e ash: optional printf builtin. +25 bytes if off, +35 if on.
by Cristian Ionescu-Idbohrn.
2008-06-01 22:36:39 +00:00
Bernhard Reutner-Fischer
5e25ddb7d3 - use STD*_FILENO some more. No object-code changes 2008-05-19 09:48:17 +00:00
Bernhard Reutner-Fischer
636a1f85e8 - use EXIT_{SUCCESS,FAILURE}. No object-code changes 2008-05-19 09:29:47 +00:00
Denis Vlasenko
29eb3599e4 ash: more of -Wall fixes 2008-05-18 14:06:08 +00:00
Denis Vlasenko
6b06cb80be more of -Wall fixes from Cristian Ionescu-Idbohrn.
Some are fixing real bugs.

function                                             old     new   delta
syslogd_main                                         938     958     +20
get_signum                                           136     143      +7
obj_load                                             777     782      +5
recv_from_to                                         210     214      +4
get_next_block                                      1795    1799      +4
display_topmem_process_list                         1117    1121      +4
logread_main                                         484     487      +3
buffer_fill_and_print                                 73      76      +3
kill_main                                            687     689      +2
ll_remember_index                                    240     241      +1
do_stats                                             452     453      +1
if_readconf                                          166     165      -1
display_process_list                                1192    1191      -1
run_applet_and_exit                                  507     505      -2
print_signames                                        33      31      -2
parse_one_line                                      1092    1090      -2
find_out_spec                                         57      55      -2
add_ksymoops_symbols                                 421     419      -2
ash_main                                            1407    1402      -5
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 11/8 up/down: 54/-17)            Total: 37 bytes
2008-05-15 21:30:45 +00:00
Denis Vlasenko
dddfaff363 ash: make set -o and set +o work as in dash/bash.
by Cristian Ionescu-Idbohrn.

function                                             old     new   delta
options                                              565     625     +60
getoptscmd                                           709     698     -11
2008-05-06 15:30:27 +00:00
Denis Vlasenko
c7131c3e58 ash: fix breakage introduced in rev 21481.
Fixes ash-vars/var_posix1.tests testsuite entry.
2008-04-14 01:59:53 +00:00
Denis Vlasenko
7465dbcf2a ash: speed up NOFORK code in ash by eliminating second find_applet().
some code reduction along the way.

function                                             old     new   delta
run_list                                            1971    1981     +10
run_nofork_applet_prime                              181     182      +1
unsetcmd                                              97      96      -1
delete_cmd_entry                                      54      53      -1
describe_command                                     399     397      -2
cmdlookup                                            152     150      -2
evaltreenr                                           602     599      -3
evaltree                                             602     599      -3
clearcmdentry                                        101      98      -3
cdcmd                                                675     672      -3
hashcmd                                              305     301      -4
find_command                                         933     910     -23
evalcommand                                         1371    1229    -142
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/11 up/down: 11/-187)         Total: -176 bytes
2008-04-13 02:25:53 +00:00
Denis Vlasenko
9bc80d7062 ash: add FEATURE_SH_NOFORK support 2008-04-12 20:07:53 +00:00
Denis Vlasenko
4a9ca13fe7 ash: do not do find_applet() twice in shellexec/tryexec 2008-04-12 20:07:08 +00:00
Denis Vlasenko
468aea2d88 shells: do not frocibly enable test, echo and kill _applets_,
just build relevant source and use xxx_main functions.
build system: add a special case when we have exactly one applet enabled
(makes "true", "false", "basename" REALLY tiny).
getopt32: do not use stdio.

function                                             old     new   delta
getopt32                                            1385    1412     +27
make_device                                         1187    1200     +13
basename_main                                        120     127      +7
tcpudpsvd_main                                      1922    1926      +4
testcmd                                                5       -      -5
echocmd                                                5       -      -5
fuser_main                                          1243    1231     -12
------------------------------------------------------------------------------
(add/remove: 0/2 grow/shrink: 4/1 up/down: 51/-22)             Total: 29 bytes
2008-04-01 14:47:57 +00:00
Denis Vlasenko
80591b0a00 ash: support for && and || in [[ expr ]]; add testsuite checks 2008-03-25 07:49:43 +00:00
Denis Vlasenko
f7d5665969 ash: comment about [[; code style fixes. No code changes. 2008-03-25 05:51:41 +00:00
Denis Vlasenko
92e13c2a11 ash: optional bash-like pattern subst and substring opts
(by James Simmons <jsimmons AT infradead.org>)
TODO: write testsuite!

BASH_COMPAT off:
scanleft                                             101     262    +161
subevalvar                                           346     335     -11
BASH_COMPAT on:
subevalvar                                           346    1397   +1051
scanleft                                             101     262    +161
readtoken1                                          2739    2807     +68
cmdputs                                              397     399      +2
static.vstype                                         64      48     -16
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/1 up/down: 1282/-16)         Total: 1266 bytes
2008-03-25 01:17:40 +00:00
Denis Vlasenko
59f351ccda ash: add read -u; fix read -t and read -n; add testsuite entries. 2008-03-25 00:07:12 +00:00
Denis Vlasenko
85c247161b *: fix fallout from -Wunused-parameter
function                                             old     new   delta
bbunpack                                             358     366      +8
passwd_main                                         1070    1072      +2
handle_incoming_and_exit                            2651    2653      +2
getpty                                                88      86      -2
script_main                                          975     972      -3
inetd_main                                          2036    2033      -3
dname_enc                                            377     373      -4
make_new_session                                     474     462     -12
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/5 up/down: 12/-24)            Total: -12 bytes
   text    data     bss     dec     hex filename
 797429     658    7428  805515   c4a8b busybox_old
 797417     658    7428  805503   c4a7f busybox_unstripped
2008-03-17 09:04:04 +00:00
Denis Vlasenko
68404f13d4 *: add -Wunused-parameter; fix resulting breakage
function                                             old     new   delta
procps_scan                                         1265    1298     +33
aliascmd                                             278     283      +5
parse_file_cmd                                       116     120      +4
dname_enc                                            373     377      +4
setcmd                                                90      93      +3
execcmd                                               57      60      +3
count_lines                                           72      74      +2
process_command_subs                                 340     339      -1
test_main                                            409     407      -2
mknod_main                                           179     177      -2
handle_incoming_and_exit                            2653    2651      -2
argstr                                              1312    1310      -2
shiftcmd                                             131     128      -3
exitcmd                                               46      43      -3
dotcmd                                               297     294      -3
breakcmd                                              86      83      -3
evalpipe                                             353     349      -4
evalcommand                                         1180    1176      -4
evalcmd                                              109     105      -4
send_tree                                            374     369      -5
mkfifo_main                                           82      77      -5
evalsubshell                                         152     147      -5
typecmd                                               75      69      -6
letcmd                                                61      55      -6
add_cmd                                             1190    1183      -7
main                                                 891     883      -8
ash_main                                            1415    1407      -8
parse_stream                                        1377    1367     -10
alloc_procps_scan                                     55       -     -55
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 7/21 up/down: 54/-148)          Total: -94 bytes
   text    data     bss     dec     hex filename
 797195     658    7428  805281   c49a1 busybox_old
 797101     658    7428  805187   c4943 busybox_unstripped
2008-03-17 09:00:54 +00:00
Denis Vlasenko
3f165fa5b3 libbb: introduce and use sigprocmask_allsigs and sigaction_set.
libbb: rename sig_pause to wait_for_any_sig.
2008-03-17 08:29:08 +00:00
Denis Vlasenko
8e2cfec1cd libbb: introduse and use signal_[no_]SA_RESTART_empty_mask and sigaction_set
signal_SA_RESTART_empty_mask                           -      65     +65
signal_no_SA_RESTART_empty_mask                        -      54     +54
dd_main                                             1325    1369     +44
sigaction_set                                          -      19     +19
dname_enc                                            373     377      +4
UNSPEC_print                                          64      66      +2
setsignal                                            296     294      -2
bb_signals_recursive                                  95      92      -3
bb_askpass                                           367     361      -6
inetd_main                                          1810    1797     -13
rx_main                                              912     883     -29
sigdelset                                             32       -     -32
__sigdelset                                           32       -     -32
__GI_sigdelset                                        32       -     -32
sighup_handler                                        84      37     -47
arping_main                                         1844    1797     -47
fsck_main                                           1869    1807     -62
run_list                                            1917    1844     -73
vlock_main                                           492     409     -83
progressmeter                                        883     798     -85
handle_incoming_and_exit                            2737    2651     -86
------------------------------------------------------------------------------
(add/remove: 3/3 grow/shrink: 3/12 up/down: 188/-632)        Total: -444 bytes
2008-03-12 23:19:35 +00:00
Denis Vlasenko
574f2f4394 *: add optimization barrier to all "G trick" locations 2008-02-27 18:41:59 +00:00
Denis Vlasenko
6aa74fcf5b ash: s/ckzmalloc/ckzalloc/ 2008-02-21 04:35:14 +00:00
Denis Vlasenko
838ffd5be2 ash: sprinkle a bit more of zeroed allocations. 2008-02-21 04:32:08 +00:00
Denis Vlasenko
e376d454bb libbb: introduce and use nonblock_safe_read(). Yay!
Our shells are immune from this nasty O_NONBLOCK now!

function                                             old     new   delta
nonblock_safe_read                                     -      78     +78
file_get                                             276     295     +19
generateMTFValues                                    428     435      +7
read_line_input                                     1776    1772      -4
preadbuffer                                          543     450     -93
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 2/2 up/down: 104/-97)             Total: 7 bytes
   text    data     bss     dec     hex filename
 615190     715   23924  639829   9c355 busybox_old
 615168     715   23924  639807   9c33f busybox_unstripped
2008-02-20 22:23:24 +00:00
Denis Vlasenko
597906c436 ash: introduce and use stzalloc and ckzalloc.
function                                             old     new   delta
stzalloc                                               -      29     +29
ckzalloc                                               -      29     +29
recordregion                                         108     102      -6
cmdlookup                                            158     152      -6
pipeline                                             188     181      -7
parseheredoc                                         135     128      -7
makename                                              42      35      -7
list                                                 355     348      -7
setvareq                                             221     212      -9
aliascmd                                             324     311     -13
pushfile                                              83      69     -14
readtoken1                                          2872    2849     -23
parse_command                                       1430    1391     -39
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 0/11 up/down: 58/-138)          Total: -80 bytes
   text    data     bss     dec     hex filename
 577227     706   23740  601673   92e49 busybox_old
 577147     706   23740  601593   92df9 busybox_unstripped
2008-02-20 16:38:54 +00:00
Denis Vlasenko
c12d51e94e ash: fix fallout from "A=1 B=$A; echo $B" code. 2008-02-19 23:31:05 +00:00
Denis Vlasenko
56244736ec whitespace fixes 2008-02-17 15:14:04 +00:00
Denis Vlasenko
0e6f661e23 ash: handle "A=1 A=2 B=$A; echo $B". closes bug 947. 2008-02-15 15:02:15 +00:00
Denis Vlasenko
94e87bc83d ash: explain why "set -o BOGUS" doesn't abort 2008-02-14 16:51:58 +00:00
Denis Vlasenko
28bf671d6d ash: make ash -c 'if set -o barfoo 2>/dev/null; then echo foo; else echo bar; fi' work
(fixes bug 1142)

function                                             old     new   delta
options                                              551     565     +14
ash_main                                            1397    1411     +14
setcmd                                                77      90     +13
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/0 up/down: 41/0)               Total: 41 bytes
2008-02-14 15:01:47 +00:00
Denis Vlasenko
e26b2783a5 ash: fix warning about _GNU_SOURCE being redefined, fix typo in comment. 2008-02-12 07:40:29 +00:00
Denis Vlasenko
991a1da148 ash: fix "orwell bug" 1984. Testcase:
trap_handler() {
        echo trap
    }
    trap trap_handler USR1
    sleep 3600 &
    while true; do wait; done
2008-02-10 19:02:53 +00:00
Denis Vlasenko
5c3d2b334a ash: readability enhancement, no code changes 2008-02-03 22:01:08 +00:00
Denis Vlasenko
36fc3cd8bc ash: code readability enhancements, no real code changes 2008-01-29 09:23:49 +00:00
Denis Vlasenko
847fa779af *: tidy up usage of char **environ 2008-01-28 22:45:43 +00:00
Denis Vlasenko
fb0eba706c libbb: introduce and use safe_waitpid (loops in EINTR)
*: use more approproate (shorter) versions of wait()

function                                             old     new   delta
safe_waitpid                                           -      48     +48
wait_any_nohang                                        -      17     +17
send_tree                                            365     369      +4
processorstop                                        432     435      +3
text_yank                                            110     108      -2
make_human_readable_str                              202     200      -2
crond_main                                          1368    1366      -2
handle_sigchld                                        49      43      -6
reapchild                                            166     159      -7
custom                                               260     250     -10
checkscript                                          191     177     -14
wait_nohang                                           17       -     -17
wait_pid                                              43       -     -43
------------------------------------------------------------------------------
(add/remove: 2/2 grow/shrink: 2/7 up/down: 72/-103)           Total: -31 bytes
2008-01-02 19:55:04 +00:00
Denis Vlasenko
ee87ebf381 fix buglets found by randomconfig 2007-12-21 22:18:16 +00:00
Denis Vlasenko
0163111325 ash: reduce global data/bss usage
(add/remove: 4/29 grow/shrink: 76/21 up/down: 1007/-1713)    Total: -706 bytes
   text    data     bss     dec     hex filename
 777206    1084    8976  787266   c0342 busybox_old
 778077     908    7568  786553   c0079 busybox_unstripped
2007-12-16 17:20:38 +00:00
Denis Vlasenko
9cb220be9d lineedit: don't violate API if we do simple fgets
ash: cosmetic style fixes, no code changes
2007-12-09 10:03:28 +00:00
Denis Vlasenko
1aa7e477b1 reorganize applet table. Eliminates pointers to names.
Should be a big win for libbusybox. busybox wins too:

   text    data     bss     dec     hex filename
 776524     929    9100  786553   c0079 busybox_old
 775903     929    9100  785932   bfe0c busybox_unstripped
2007-11-28 06:49:03 +00:00
Denis Vlasenko
ed270a5f32 ash: make code simpler, and do not do close(-1) - it's rude 2007-11-26 05:37:07 +00:00
Denis Vlasenko
fe5e23bf75 remove echo_main -> bb_echo indirection 2007-11-24 02:23:51 +00:00
Denis Vlasenko
7d75a96b15 ash: fix bug where redirection of closed fd was leaving it open afterwards.
redirect                                             983    1024     +41
bb_echo                                              276     301     +25
popredir                                             118     132     +14
evalcommand                                         1163    1176     +13
bbunpack                                             358     366      +8
echocmd                                               13       5      -8
echo_main                                             13       5      -8
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 5/2 up/down: 101/-16)            Total: 85 bytes
   text    data     bss     dec     hex filename
 774999     962    9236  785197   bfb2d busybox_old
 775084     962    9236  785282   bfb82 busybox_unstripped
2007-11-22 08:16:57 +00:00
Denis Vlasenko
a59f435b5f ash: if tcgetattr(stdin) fails, don't mess with tcsetattr
ash: size-optimize ulimit's table of limits

   text    data     bss     dec     hex filename
 777345     974    9676  787995   c061b busybox_old
 777253     974    9676  787903   c05bf busybox_unstripped
2007-10-29 19:17:29 +00:00
Denis Vlasenko
037576d77b read_line_input: fix it to not do any fancy editing if echoing is disabled.
ash: make read handling both more correct and smaller

read_line_input                                     4037    4101     +64
input_backward                                       140     139      -1
readcmd                                             1079    1070      -9
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/2 up/down: 65/-10)             Total: 54 bytes
   text    data     bss     dec     hex filename
 777575    1000    9532  788107   c068b busybox_old
 777629    1000    9532  788161   c06c1 busybox_unstripped
2007-10-20 18:30:38 +00:00
Denis Vlasenko
0de37e10ed ash: use fdprintf, not dprintf.
*: trailing whitespace removed
2007-10-17 11:08:53 +00:00
Denis Vlasenko
9b49a5ed85 add -fvisibility=hidden to CC flags, mark XXX_main functions
EXTERNALLY_VISIBLE. 5% size reduction of libbusybox.so
2007-10-11 10:05:36 +00:00
Denis Vlasenko
82d38dab91 get rid of global "struct bb_applet *current_applet" 2007-10-10 14:38:47 +00:00
Denis Vlasenko
41770226bb ash: revert "cat | jobs" fix, it causes more problems than good 2007-10-07 18:02:52 +00:00
Denis Vlasenko
96e1b38586 introduce and use close_on_exec_on(fd). -50 bytes. 2007-09-30 23:50:48 +00:00
Denis Vlasenko
6081868ee3 fix "if (p) free(p)" constructs 2007-09-28 22:07:23 +00:00
Denis Vlasenko
46a530626d ash: fix prompt expansion (Natanael Copa <natanael.copa@gmail.com>) 2007-09-24 18:30:02 +00:00
Denis Vlasenko
7b70d78de8 ash: remove erroneously applied patch 2007-09-21 22:48:02 +00:00
Denis Vlasenko
f431017535 httpd: optional support for partial downloads 2007-09-21 22:35:18 +00:00
Denis Vlasenko
bcceb0c5a4 ash: s/int/smallint/. -60 bytes. 2007-09-21 18:06:20 +00:00
Denis Vlasenko
87f3b26b3a *: replace select-for-one descriptor with poll, it's smaller.
$ ./.cmk bloatcheck
function                                             old     new   delta
readit                                               406     364     -42
syslogd_main                                        1249    1206     -43
traceroute_main                                     4115    4060     -55
mysleep                                              112      45     -67
arpping                                              579     441    -138
tftp                                                1575    1182    -393
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/6 up/down: 0/-738)           Total: -738 bytes
   text    data     bss     dec     hex filename
 770580    1051   10764  782395   bf03b busybox_old
 769820    1051   10764  781635   bed43 busybox_unstripped
2007-09-07 13:43:28 +00:00
Denis Vlasenko
d37f22225b libbb,crond,lash: fix getopt32 (don't know how it managed to slip through)
*: fcntl(fd, F_GETFL) doesn't require third parameter at all.
2007-08-19 13:42:08 +00:00
Denis Vlasenko
6ca409e0e4 trylink: produce even more info about final link stage
trylink: explain how to modify link and drastically decrease amount
  of padding (unfortunately, needs hand editing ATM).
*: add ALIGN1 / ALIGN2 to global strings and arrays of bytes and shorts

size saving: 0.5k
2007-08-12 20:58:27 +00:00
Denis Vlasenko
dee82b6b78 ash: comment non-obvious code part 2007-07-29 14:05:27 +00:00
Denis Vlasenko
b71c668c57 style fix (stray space before ';') 2007-07-21 15:08:09 +00:00
Denis Vlasenko
d4293c77f1 ash: fix SEGV in forkchild (jp can be NULL). here documents were affected. 2007-07-18 21:35:43 +00:00
Denis Vlasenko
bdc406d15d ash: make "jobs | cat" work like in bash (was giving empty output) 2007-07-15 01:13:25 +00:00
Denis Vlasenko
fcfaf2e18a ash: small size optimization
function                                             old     new   delta
makejob                                              263     270      +7
setjobctl                                            328     332      +4
jobscmd                                               96      94      -2
stoppedjobs                                           53      50      -3
jobctl                                                 4       1      -3
job_warning                                            4       1      -3
forkshell                                            644     641      -3
cmdloop                                              422     409     -13
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/6 up/down: 11/-27)            Total: -16 bytes
   text    data     bss     dec     hex filename
 675392    2740   13968  692100   a8f84 busybox_old
 675380    2740   13968  692088   a8f78 busybox_unstripped
2007-07-14 18:45:37 +00:00
Denis Vlasenko
8fdc4b7b06 ash: recognize -l as --login equivalent; do not recognize +-login 2007-07-14 11:33:10 +00:00
Denis Vlasenko
40ba9984fd ash: fix for buglet in DEBUG code (Nguyen Thai Ngoc Duy <pclouds@gmail.com>) 2007-07-14 00:48:29 +00:00
Denis Vlasenko
1fc6238ffa devfsd: fix formatting (Tito <farmatito@tiscali.it>)
ash: fix SEGV if type has zero parameters
2007-06-25 22:55:34 +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
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
ca525b4f24 *: BB_BANNER -> bb_banner (it is not a const or #define)!
correct_password: explain in detail why it is ok to use bb_banner
fsck_minix: make it print bb version, not it's own (outdated/irrelevant) one

Marginal size difference:
   text    data     bss     dec     hex filename
 679119    2700   15632  697451   aa46b busybox_old
 679091    2700   15632  697423   aa44f busybox_unstripped
2007-06-13 12:27:17 +00:00
Denis Vlasenko
d67cef2425 hush: fix read builtin to not read ahead past eol and to not use
insane amounts of stack. Testsuite updated.
2007-06-13 06:47:47 +00:00
Denis Vlasenko
f5f75c5e82 remove nearly-duplicate PATHs in several places
function                                             old     new   delta
bb_PATH_root_path                                      -      35     +35
varunset                                              60      58      -2
arith                                               2042    2033      -9
bb_default_root_login_path                            30       -     -30
.rodata                                           128794  128762     -32
which_main                                           152     117     -35
defpathvar                                            40       -     -40
------------------------------------------------------------------------------
(add/remove: 1/2 grow/shrink: 0/4 up/down: 35/-148)          Total: -113 bytes
2007-06-12 22:35:19 +00:00
Denis Vlasenko
bdbbb7ec49 make busybox --install work even if /proc/self/exe doesn't exist
# size busybox_old busybox_unstripped
   text    data     bss     dec     hex filename
 680095    2704   15648  698447   aa84f busybox_old
 680099    2704   15648  698451   aa853 busybox_unstripped
2007-06-08 15:02:55 +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
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
46846e25a4 ash: implement type -p, costs less than 10 bytes
(patch by Mats Erik Andersson <mats.andersson64@comhem.se>)
2007-05-20 13:08:31 +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
f20de5bb42 ash,kill: use common code for kill applet/builtin
# make bloatcheck
function                                             old     new   delta
evaltreenr                                           644     654     +10
evaltree                                             644     654     +10
parse_conf                                          1440    1444      +4
dpkg_deb_main                                        426     429      +3
ed_main                                             3319    3321      +2
passwd_main                                         2093    2091      -2
kill_main                                            830     826      -4
singlemount                                         4609    4601      -8
find_command                                         962     954      -8
get_lcm                                              123     105     -18
.rodata                                           132243  132147     -96
killcmd                                              449     120    -329
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 5/7 up/down: 29/-465)          Total: -436 bytes

# size busybox_old busybox_unstripped
   text    data     bss     dec     hex filename
 723901    2940   27504  754345   b82a9 busybox_old
 723457    2940   27504  753901   b80ed busybox_unstripped
2007-04-29 23:42:54 +00:00
Denis Vlasenko
08c8c1d3b3 ash: fix infinite loop on exit if tty is not there anymore 2007-04-28 22:39:02 +00:00
Denis Vlasenko
f5294e1f4c hush: use NOFORK applets as appropriate. Net reduction of code size. 2007-04-14 10:09:57 +00:00
Denis Vlasenko
16abcd90ae teach find_root_device to deal with /dev/ subdirs
(by "Kirill K. Smirnov" <lich@math.spbu.ru>)
2007-04-13 23:59:52 +00:00
Denis Vlasenko
d7c8196c1b ash: fix kill -l (by Mats Erik Andersson <mats.andersson64@comhem.se>) 2007-04-11 20:43:31 +00:00
Denis Vlasenko
80d14beae9 Rename two config options:
FEATURE_SH_STANDALONE_SHELL => FEATURE_SH_STANDALONE
FEATURE_EXEC_PREFER_APPLETS => FEATURE_PREFER_APPLETS
Make SH_STANDALONE depend on PREFER_APPLETS.
getopt.c: more randomconfig-induced fixes
2007-04-10 23:03:30 +00:00
Denis Vlasenko
335b63d8d1 make a few struct bb_applet members conditional
rename sllep_and_die -> xfunc_die
make fflush_stdout_and_exit NOFORK-safe
fix some buglets found by randomconfig
2007-04-10 21:38:30 +00:00
Denis Vlasenko
c44ab01b75 Improve STANDALONE_SHELL. "safe" applets are renamed NOEXEC applets
and now this fact is recorded in applets.h, not ash.c.

Several fixes to "--help + STANDALONE_SHELL" scenarios.

function                                             old     new   delta
run_current_applet_and_exit                            -     355    +355
arith                                               2064    2073      +9
refresh                                             1148    1156      +8
getopt32                                            1068    1073      +5
telnet_main                                         1510    1514      +4
md5_sha1_sum_main                                    565     566      +1
xstrtoul_range_sfx                                   255     251      -4
packed_usage                                       22523   22514      -9
tryexec                                              255     203     -52
static.safe_applets                                  152       -    -152
.rodata                                           131320  131128    -192
run_applet_by_name                                   869     506    -363
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 5/5 up/down: 382/-772)         Total: -390 bytes

./busybox ash -c 'i=20000; while test $i != 0; do touch z; i=$((i-1)); done'
runs more than twice as fast with STANDALONE_SHELL versus without.
2007-04-09 03:11:58 +00:00
Denis Vlasenko
240a1cfbbe add some missed statics on constant objects.
fix few #ifndef ENABLE_xxx

# size busybox_old busybox_unstripped
   text    data     bss     dec     hex filename
 677152    2920   18208  698280   aa7a8 busybox_old
 676420    2920   18208  697548   aa4cc busybox_unstripped
2007-04-08 16:07:02 +00:00
Denis Vlasenko
7c139b4778 ash: fix signal handling 2007-03-21 20:17:27 +00:00