Commit Graph

1369 Commits

Author SHA1 Message Date
Denis Vlasenko
46ccdcb96e hush: search/and/replace style cleanups, no code changes 2008-06-10 18:05:12 +00:00
Denis Vlasenko
7b4f3f13d3 hush: fix two nasty bugs:
hush-bugs/tick2.tests: ok
hush-bugs/tick.tests: ok

function                                             old     new   delta
parse_stream                                        1332    1557    +225
b_addptr                                               -      97     +97
add_till_backquote                                     -      82     +82
b_addstr                                               -      58     +58
b_grow_by                                              -      50     +50
setup_string_in_str                                    -      29     +29
expand_variables                                    1196    1199      +3
expand_on_ifs                                        100      97      -3
b_addqchr                                             57      50      -7
parse_and_run_string                                  48      31     -17
lookup_param                                          27       -     -27
b_addchr                                              75      45     -30
count_ifs                                             44       -     -44
process_command_subs                                 222       -    -222
------------------------------------------------------------------------------
(add/remove: 5/3 grow/shrink: 2/4 up/down: 544/-350)          Total: 194 bytes
   text    data     bss     dec     hex filename
 759354     604    6684  766642   bb2b2 busybox_old
 759534     604    6684  766822   bb366 busybox_unstripped
2008-06-10 18:04:32 +00:00
Denis Vlasenko
76d50418b3 hush: fix a memory leak in NOMMU case 2008-06-10 16:19:39 +00:00
Denis Vlasenko
3fe4f986a0 less: fix a case when regexp matches ""
hush: remove wrong comment, expand another one
2008-06-09 16:02:39 +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
598bb732e8 cosmetics 2008-06-09 07:58:53 +00:00
Denis Vlasenko
2d0529c9bc msh_function.patch: picked it up in the wild.
Fixed allocation bugs (it was allocating
one too small vectors) but it still is very buggy,
thus not applied.
2008-06-09 07:50:25 +00:00
Denis Vlasenko
ed9d621cf4 msh: style cleanups. No code changes. 2008-06-09 07:44:19 +00:00
Denis Vlasenko
b8c9354114 hush: add yet another bug to testsuite :( 2008-06-08 16:47:09 +00:00
Denis Vlasenko
66d56c565e ash testsuite: modify it so that it can run hush and msh tests 2008-06-05 09:07:02 +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
Denis Vlasenko
d78920675f msh: fix ENOENT testcase 2008-06-01 14:16:54 +00:00
Denis Vlasenko
447bd66837 msh: fix the case where the file has exec bit but can't be run directly
(run "$SHELL $file" instead)
msh: fix exit codes when command is not found or can't be execed
     (with testcases)
2008-05-30 22:28:32 +00:00
Denis Vlasenko
4830fc565a hush: make it ignore SIGINT etc in a config wich has no job control 2008-05-25 21:50:55 +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
Mike Frysinger
b81f97bbd2 fix by Jie Zhang for exit status and POSIX compliance:
http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html
The exit status of a command that terminated because it received a signal shall be reported as greater than 128.
2008-05-14 11:51:04 +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
bc1918a7a2 trivial fixes to make bbox compile with gcc 4.3.0 2008-04-15 01:17:50 +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
6d1ebecf65 ash: add another testsuite entry ("leaking variables" bug) 2008-04-13 17:45:56 +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
f78a656f7c ash: a bit more complete POSIX subst testsuite entry 2008-04-12 23:02:43 +00:00
Denis Vlasenko
033424a213 ash: add testsuite entry for POSIX-mandated ${var#word} ${var##word}
${var%word} ${var%%word}
2008-04-12 22:55:33 +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
93b8263652 fix build with gcc -combine 2008-04-11 11:27:29 +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
c693840fe8 *: whitespace fixes, no code changes 2008-03-24 02:18:03 +00:00
Denis Vlasenko
42cc304e90 lpr: add more accurate comments
*: trailing whitespace removal
2008-03-24 02:05:58 +00:00
Denis Vlasenko
0b6c6a9c9f lpd: fix OOM vulnerability (was eating arbitrarily large commands) 2008-03-24 00:04:42 +00:00
Denis Vlasenko
c93b162248 patch: shrink by Pascal Bellard <pascal.bellard AT ads-lu.com> (-80 bytes)
*: removal of #include <getopt.h>
2008-03-23 22:55:25 +00:00
Denis Vlasenko
f90ab183d6 *: use fopen_or_warn in few more places 2008-03-20 21:19:35 +00:00
Denis Vlasenko
62a90cdd74 *: shrink by using [f]open_or_warn_stdin where appropriate
function                                             old     new   delta
lsattr_main                                           62     143     +81
open_or_warn_stdin                                     -      36     +36
fclose_if_not_stdin                                   20      47     +27
xfopen_stdin                                           -      20     +20
tac_main                                             336     356     +20
cksum_main                                           249     259     +10
bb_argv_dash                                           -       8      +8
su_main                                              448     455      +7
cmp_main                                             630     633      +3
passwd_main                                         1072    1074      +2
uudecode_main                                        317     315      -2
text_yank                                            110     108      -2
handle_incoming_and_exit                            2653    2651      -2
flags                                                  5       1      -4
write_leases                                         235     230      -5
fopen_or_warn_stdin                                   48      42      -6
fold_main                                            648     642      -6
static.argv_dash                                       8       -      -8
sum_main                                             142     128     -14
tail_main                                           1237    1221     -16
sed_main                                             711     695     -16
cmp_xfopen_input                                      17       -     -17
bb_cat                                               113      96     -17
catv_main                                            328     306     -22
strings_main                                         457     434     -23
hash_file                                            298     274     -24
sum_file                                             353     325     -28
sort_main                                            904     859     -45
expand_main                                          736     686     -50
cut_main                                            1116    1065     -51
md5_sha1_sum_main                                    549     493     -56
lsattr_args                                           90       -     -90
read_stduu                                           408     255    -153
------------------------------------------------------------------------------
(add/remove: 3/3 grow/shrink: 7/20 up/down: 214/-657)        Total: -443 bytes
   text    data     bss     dec     hex filename
 797417     658    7428  805503   c4a7f busybox_old
 796973     658    7428  805059   c48c3 busybox_unstripped
2008-03-17 09:07:36 +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
a43dba76ea msh: create testsuite (based on hush one)
hush: add TODO (doesn't know ":" command)
2008-03-02 19:57:53 +00:00
Denis Vlasenko
4aafd5f4e3 msh: a few fields renamed; short->int conversion for a field
holding file descriptors; short->smalling for flag field

synio                                                263     264      +1
readc                                                247     242      -5
forkexec                                            1339    1307     -32
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/2 up/down: 1/-37)             Total: -36 bytes
2008-03-02 14:33:26 +00:00
Denis Vlasenko
fb29038b59 libbb: inntroduce and use bb_pstrcmp() and qsort_string_vector()
msh: glob0/glob1/glob2/glob3 are just a sorting routine! remove them.

bb_pstrcmp                                             -      25     +25
qsort_string_vector                                    -      24     +24
expand                                              2209    2227     +18
getopt32                                            1359    1370     +11
passwd_main                                         1072    1074      +2
handle_incoming_and_exit                            2737    2735      -2
UNSPEC_print                                          66      64      -2
forkexec                                            1343    1339      -4
input_tab                                           3338    3330      -8
get_dir                                              185     177      -8
expmeta                                              481     473      -8
cmdputs                                              405     397      -8
xstrcmp                                               12       -     -12
find_pair                                            187     167     -20
match_compare                                         25       -     -25
dir_strcmp                                            25       -     -25
glob2                                                 27       -     -27
glob3                                                 34       -     -34
glob1                                                256       -    -256
------------------------------------------------------------------------------
(add/remove: 2/6 grow/shrink: 3/8 up/down: 80/-439)          Total: -359 bytes
2008-03-02 12:51:26 +00:00
Denis Vlasenko
509697f00d msh: renames: ->words => ->op_words, space() => get_space()
msh: simplify glob0/glob1/glob2/glob3

get_space                                              -      26     +26
glob3                                                 35      34      -1
glob2                                                 28      27      -1
strsave                                               55      53      -2
globv                                                  4       -      -4
func                                                   4       -      -4
xstrcmp                                               25      12     -13
dodot                                                178     164     -14
rexecve                                              272     257     -15
space                                                 26       -     -26
glob1                                                292     256     -36
expand                                              2246    2209     -37
------------------------------------------------------------------------------
(add/remove: 1/3 grow/shrink: 0/8 up/down: 26/-153)          Total: -127 bytes
2008-03-02 12:49:39 +00:00
Denis Vlasenko
fe2188378c msh: fix for bug 846 ("break" didn't work second time)
msh: don't use floating point in "times" builtin
+4 bytes difference
2008-03-01 09:35:39 +00:00
Denis Vlasenko
574f2f4394 *: add optimization barrier to all "G trick" locations 2008-02-27 18:41:59 +00:00
Denis Vlasenko
400d8bb45e less,klogd,syslogd,nc,tcpudp: exit on signal by killing itself, not exit(1)
*: minor shrink
2008-02-24 13:36:01 +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
25591c322c libbb: introduce bb_signals and bb_signals_recursive,
which sets same handler for many signals. sig_catch is nuked
(bb_signals_recursive is more descriptive name).
*: use them as appropriate. 

function                                             old     new   delta
bb_signals_recursive                                   -      95     +95
bb_signals                                             -      52     +52
run_command                                          258     273     +15
svlogd_main                                         1368    1377      +9
runsv_main                                          1746    1752      +6
runsvdir_main                                       1643    1646      +3
UNSPEC_print                                          64      66      +2
time_main                                           1128    1127      -1
...
resize_main                                          246     210     -36
sig_catch                                             63       -     -63
set_fatal_sighandler                                  85      14     -71
------------------------------------------------------------------------------
(add/remove: 2/1 grow/shrink: 5/24 up/down: 182/-548)        Total: -366 bytes
2008-02-16 22:58:56 +00:00
Denis Vlasenko
284d0faed6 random s/short/int/
add_cmd                                             1189    1190      +1
xconnect_ftpdata                                     118     117      -1
data_align                                            86      84      -2
process_files                                       2101    2096      -5
forkexec                                            1345    1334     -11
2008-02-16 13:18:17 +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
773f6710c1 typo fix 2008-02-14 10:31:18 +00:00
Denis Vlasenko
12c0622231 tar: do "short EOF" compat only if CONFIG_DESKTOP.
ash: add a comment about new minor bug
2008-02-14 08:52:30 +00:00
Denis Vlasenko
65eb550024 reinstate redir.tests with correct perms 2008-02-13 18:10:46 +00:00
Denis Vlasenko
81887e2342 ash: add a testcase for recently fixed signal bug 2008-02-13 18:09:56 +00:00
Denis Vlasenko
fee2d0c256 msh: stop trying to parse variables in "msh SCRIPT VAR=val param".
They should be passed as ordinary parameters.
2008-02-12 10:12:18 +00:00
Denis Vlasenko
7e497527ea msh: instead of fixing "ls | cd", "cd | ls" etc just disallow
builtins in pipes. They make no sense there anyway.
msh: shrink umask builtin.

function                                             old     new   delta
execute                                             2508    2509      +1
doset                                                326     317      -9
forkexec                                            1370    1345     -25
doumask                                              165     101     -64
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/3 up/down: 1/-98)             Total: -97 bytes
2008-02-12 09:51:03 +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
648b44fd78 msh: shrink, mainly by using smallints
function                                             old     new   delta
synio                                                251     263     +12
filechar                                             310     315      +5
subgetc                                              781     785      +4
brkcontin                                            106     109      +3
...
yylex                                                981     976      -5
execute                                             2513    2508      -5
waitfor                                              321     315      -6
onintr                                               103      97      -6
doset                                                332     326      -6
doexec                                               186     180      -6
yyparse                                               65      57      -8
thenpart                                             135     126      -9
forkexec                                            1379    1370      -9
onecommand                                           457     433     -24
newtp                                                 52      28     -24
command                                             1086    1061     -25
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 7/23 up/down: 27/-163)         Total: -136 bytes
2008-02-12 06:04:06 +00:00
Denis Vlasenko
a5f2cd30c9 msh: do not run pipes where last command is a builtin
msh: code shrink and some renames for better readability
2008-02-11 18:10:06 +00:00
Denis Vlasenko
83177991c8 hush: die_sllep needs restoring only if job control is on 2008-02-11 08:44:36 +00:00
Denis Vlasenko
08126f665d hush: close-on-exec interactive_fd 2008-02-11 08:39:11 +00:00
Denis Vlasenko
459a5ad410 hush: set CLOEXEC on script file being executed 2008-02-11 08:35:03 +00:00
Denis Vlasenko
4ecfcdcced hush: fix the comment 2008-02-11 08:32:31 +00:00
Denis Vlasenko
c04163a289 hush: reset die_sleep to 0 in child after fork 2008-02-11 08:30:53 +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
0ef240d979 hush: small fixes to docs/testsuite 2008-02-10 16:00:30 +00:00
Denis Vlasenko
05743d7949 hush: reinstate cmd handling for NOMMU (with fat big warning).
hush: fix a case where none of pipe members could be started
  because of fork failure
hush: rename functions: xxx_real -> xxx
hush: try to add a bit more of vfork-friendliness
hush: add rudimentary design docs
hush: add TODO (newly discovered bug with globbing)
2008-02-10 12:10:08 +00:00
Denis Vlasenko
5c3d2b334a ash: readability enhancement, no code changes 2008-02-03 22:01:08 +00:00
Denis Vlasenko
6e602c4931 msh: also handle EOF/read errors correctly 2008-02-02 18:50:50 +00:00
Denis Vlasenko
80667e30fb msh: fix Ctrl-C handling with line editing 2008-02-02 18:35:55 +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
d2c450ce81 hush: report [v]fork failures
hush: more correct handling of piping
config: add CONFIG_NOMMU
2008-01-08 20:32:12 +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
Mike Frysinger
08137c28c4 add expected output 2007-12-25 04:35:05 +00:00
Denis Vlasenko
3b4921674e hush: fixlet for NOMMU
update TODO_config_nommu
2007-12-24 14:26:57 +00:00
Denis Vlasenko
528a8b9769 cttyhack: trivial build fixlet 2007-12-22 19:57:28 +00:00
Denis Vlasenko
ee87ebf381 fix buglets found by randomconfig 2007-12-21 22:18:16 +00:00
Denis Vlasenko
c794c51a1a msh: reduce global data/bss usage
(add/remove: 1/5 grow/shrink: 28/6 up/down: 464/-394)          Total: 70 bytes
   text    data     bss     dec     hex filename
 778077     908    7568  786553   c0079 busybox_old
 778330     860    7408  786598   c00a6 busybox_unstripped
2007-12-16 17:21:29 +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
d7e2e127a9 cttyhack: add missing ';'
init: remove pointless access() check
2007-12-10 08:40:29 +00:00
Denis Vlasenko
2afabe8b83 init: remove superfluous forks and messing up with argv[0]
cttyhack: add stealing of ctty
2007-12-10 07:06:04 +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
ab801874f8 attack the biggest stack users:
-mkfs_minix_main [busybox_unstripped]:                  4288
-mkfs_minix_main [busybox_unstripped]:                  4276
-grave [busybox_unstripped]:                            4260
(bzip2 users too - not listed)

price we pay in code size increase:
mainSort                                            2458    2515     +57
grave                                               1005    1058     +53
sendMTFValues                                       2177    2195     +18
BZ2_blockSort                                        122     125      +3
mkfs_minix_main                                     3070    3022     -48
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/1 up/down: 131/-48)            Total: 83 bytes
2007-12-02 08:35:37 +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
c3c6659f12 hush: fix segfault in "echo $@" when we have no arguments 2007-11-24 00:22:42 +00:00
Denis Vlasenko
96702ca945 kill lash. "lash" builtin still exists, but it runs hush. 2007-11-23 23:28:55 +00:00
Denis Vlasenko
5bc593ccb8 hush: implement echo builtin
builtin_echo                                           -      36     +36
bltins                                               384     396     +12
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/0 up/down: 48/0)               Total: 48 bytes
2007-11-23 21:20:21 +00:00
Denis Vlasenko
cccdc4e01a hush: fix $ expansion in redirections, add testcase for that 2007-11-23 21:08:38 +00:00
Denis Vlasenko
835068637e hush: implement test builtin 2007-11-23 13:11:42 +00:00
Denis Vlasenko
f962a0354e hush: plug memory leak 2007-11-23 12:50:54 +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
a6899c3587 lash: fix compile-time warning 2007-11-15 17:47:45 +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
0c97c9d437 'simple' error message functions by Loic Grenie <loic.grenie@gmail.com>.
263 bytes saved.
2007-10-01 11:58:38 +00:00
Denis Vlasenko
d65ea39ffc hush: fix glob() abuse. Code was making unfounded assumptions how
glob() works, and it broke horribly on specific uclibc config.
2007-10-01 10:02:25 +00:00
Denis Vlasenko
ff0976248a hush: int->smallint for flag vars; make some names more "greppable" 2007-10-01 10:00:45 +00:00
Denis Vlasenko
8412d7959a hush: feeble attempt at making it more NOMMU-friendly 2007-10-01 09:59:47 +00:00
Denis Vlasenko
a0898170d8 hush: stop doing manual acounting of open fd's, kernel can do it for us 2007-10-01 09:59:01 +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
4daad9004d introduce bb_putchar(). saves ~1800 on uclibc (less on glibc). 2007-09-27 10:20:47 +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
818322b9b1 *: kill bb_get_last_path_component, replace with two functions
(one which strips trailing slash and one which does not)
wget: straighten out as a result of above change
   text    data     bss     dec     hex filename
   5056       1       0    5057    13c1 busybox.t4/networking/wget.o
   5022       0       0    5022    139e busybox.t5/networking/wget.o
2007-09-24 18:27:04 +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
fe7cd642b0 don't pass argc in getopt32, it's superfluous
(add/remove: 0/0 grow/shrink: 12/131 up/down: 91/-727) Total: -636 bytes
   text    data     bss     dec     hex filename
 773469    1058   11092  785619   bfcd3 busybox_old
 772644    1058   11092  784794   bf99a busybox_unstripped
2007-08-18 15:32:12 +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
15611bb958 A few more string duplicates found & eliminated
# size busybox_old busybox_unstripped
   text    data     bss     dec     hex filename
 679693    2700   15632  698025   aa6a9 busybox_old
 679523    2700   15632  697855   aa5ff busybox_unstripped
2007-06-12 08:52:02 +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
42bffbf360 hush: add missing dependencies (Maxime Bizon <mbizon@freebox.fr> (Freebox)) 2007-06-08 08:02:53 +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
27f79ff03d hush: trivial buglet found by randomconfig testing 2007-05-30 00:55:52 +00:00
Denis Vlasenko
4b924f3a5c whitespace fixes 2007-05-30 00:29:55 +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
5a6aeddfa7 xpipe: introduce (saves ~170 bytes)
udhcp/signalpipe.c: use pipe instead of socketpair.
2007-05-26 16:44:20 +00:00
Denis Vlasenko
ba7cf260fd hush: fix 'echo abcsleep 5def' + Ctrl-Z and Ctrl-C bugs. +50 bytes of code. 2007-05-25 14:34:30 +00:00
Denis Vlasenko
0a83fc3984 hush: avoid duplicating HUSH_VERSION 2007-05-25 11:12:32 +00:00
Denis Vlasenko
201c72a8d6 hush: micro-optimization in new variable code 2007-05-25 10:00:36 +00:00
Denis Vlasenko
28c0f0f4fe hush: we can't do without variable->value member, saving 25 bytes of code
and some runtime memory. Rename few variables.
2007-05-25 02:46:01 +00:00
Denis Vlasenko
d76c049cc4 hush: rework variable storage and environment handling.
More that -100 bytes of code + memory leak plugged.
Added a testcase for it.
2007-05-25 02:16:25 +00:00
Denis Vlasenko
163a855731 hush: update README with yet another failure case 2007-05-24 13:52:46 +00:00
Denis Vlasenko
5a1437d835 hush: fix segfaulting syntax error in interactive hush 2007-05-24 13:22:47 +00:00
Denis Vlasenko
cd7f4d27a2 hush: improve 2 testsuite tests 2007-05-24 13:22:01 +00:00
Denis Vlasenko
2b6bbad4db hush: add 2 tests for correct syntax error reporting 2007-05-24 12:26:39 +00:00
Denis Vlasenko
b055001b6a hush: fix handling of unmatched ${name (without closing '}') -
was eating all remaining input, potentially megabytes.
nofork: save/restore die_jmp too
nofork: use -2222 instead of -111 as "special" return valur for zero
(-111 is used by some applets. -2222 won't fit in exitcode and thus safer)
2007-05-24 12:18:16 +00:00
Denis Vlasenko
90e485ce79 hush: make syntax error messages a bit more useful 2007-05-23 15:22:50 +00:00
Denis Vlasenko
1744cb1861 hush: prepare testsuite for new, fixed error message format 2007-05-23 15:16:41 +00:00
Denis Vlasenko
170435c575 hush: fix job control with eval /bin/external_prog
hush: fix parsing of unterminated "str with no EOL
hush: improved make_string() (smaller, faster, needs less RAM)
hush: renamed several functions
2007-05-23 13:01:10 +00:00
Denis Vlasenko
1a7358612f hush: fix a bit different instance of "No EOL" bug,
add testsuite for that. Expand another testsuite.
2007-05-23 00:32:25 +00:00
Denis Vlasenko
94dace3016 fix execute bit on hush-misc/shift.tests 2007-05-23 00:26:32 +00:00
Denis Vlasenko
0681033918 hush: add 3 CONFIG_xxx, allowing for smaller and less capable hush.
Minimal hush is ~9k now (lash is ~7k).
2007-05-21 23:30:54 +00:00
Denis Vlasenko
8805eeb44a shells: update README and testsuite. environment memory leak
needs to be fixed - and documented!
2007-05-21 10:19:48 +00:00
Denis Vlasenko
219e88d050 hush: using smallints where we can. save ~20 bytes in code and
some data storage at runtime.
2007-05-21 10:18:23 +00:00
Denis Vlasenko
004baba2d6 hush: fix shift + $0 bug; add testcase 2007-05-20 22:22:18 +00:00
Denis Vlasenko
262d765351 hush: trivial size optimization 2007-05-20 21:52:49 +00:00
Denis Vlasenko
14b5dd9943 hush: make process substitution configurable; add a testcase 2007-05-20 21:51:38 +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
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
c8be5ee325 hush: do "struct globals" trick. hush.o data+bss = 0 bytes now.
+60 bytes to image, but -8000 bytes in bss.
2007-05-17 15:38:46 +00:00
Denis Vlasenko
b6a741ffa7 hush: consolidated variable expansion for assignments and "normal" one.
-435 bytes. Tested against testsuite.
2007-05-17 14:38:17 +00:00
Denis Vlasenko
96f67dc69d more compile fixes from randomconfig run 2007-05-17 13:02:41 +00:00
Denis Vlasenko
c666f71e3b hush: take care of several easy FIXMEs. -228 bytes. 2007-05-16 22:18:54 +00:00
Denis Vlasenko
831dcc439c hush: another microscopic typo fix 2007-05-16 15:05:36 +00:00
Denis Vlasenko
c29903221d hush: fix English in comment 2007-05-16 12:57:12 +00:00
Denis Vlasenko
3e7b0e6120 hush: simplify read builtin; fix set_local_var (misplaced 'goto skip;') 2007-05-16 12:52:15 +00:00
Denis Vlasenko
1f4cf517f5 hush: fix expansion of quoted $VAR, $* and $@ 2007-05-16 10:39:24 +00:00
Denis Vlasenko
8f6bdb42df hush: fix incorrect processing of echo "'$var'".
hush: rename map[] and MAP_xxx, making them easier to understand.
hush: move testcase (which now passes) from hush-bugs to hush-parsing
2007-05-16 09:36:55 +00:00
Denis Vlasenko
d6050949b8 hush: move testsuite files from hush-bugs to hush-parsing
(as these bugs are now fixed)
2007-05-14 22:09:52 +00:00
Denis Vlasenko
764d59d488 hush: more fixes to variable expansion, more testcases 2007-05-14 16:23:23 +00:00
Denis Vlasenko
03eb8bf6ce hush: move towards more correct variable expansion
hush: fix a few cases in FOR v IN ... construct
      unfortunately, code growth is big - ~600 bytes
2007-05-14 16:19:34 +00:00
Denis Vlasenko
602d13cba5 hush: fix '{ false; echo $?; }' bug.
hush: expand testsuite. variable expansion is still very broken
2007-05-13 18:34:53 +00:00
Denis Vlasenko
119b995437 hush: reinstate hush_test, add testcases for process subst 2007-05-11 12:57:35 +00:00
Denis Vlasenko
3e9aaae5dc hush: fix bug in interactive shell introduced yesterday
hush: fix `process subst` (2 bugs)
NB: will delete and re-add hush_test in order to change file modes
2007-05-11 12:56:43 +00:00
Denis Vlasenko
e0a336747c hush: fix "unterminated last line loops forever" bug
hush: add testsuite infrastructure
2007-05-10 23:06:55 +00:00
Denis Vlasenko
53079d494e hush: fix recent breakage (VAR=VAL stopped working) 2007-05-10 23:05:28 +00:00
Denis Vlasenko
2b54aaa9bf msh: fix obscure case with backticks and closed fd 1 2007-05-09 22:16:08 +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
21f0d4c55e hush: fix double-free in "echo TEST &" 2007-05-06 14:15:42 +00:00
Denis Vlasenko
dd4cb2b31e hush: stop generating extra empty pipes in parse stage. 2007-05-05 15:11:40 +00:00
Denis Vlasenko
a6c467f6d1 hush: preparatory patch for removing extra empty pipes generation
in parse stage. No real code change here.
2007-05-05 15:10:52 +00:00
Denis Vlasenko
ac0e5ab96a hush: fix "while true; do true; done" + ctrl-z 2007-05-04 21:37:27 +00:00
Denis Vlasenko
3349fc4da9 applets: fix compile-time warning 2007-05-04 14:54:36 +00:00
Denis Vlasenko
400c5b6fc6 hush: add parse tree debug print 2007-05-04 13:07:27 +00:00
Denis Vlasenko
e725bfe6e0 hush: fix "true | exit 3; echo $?" bug 2007-05-03 22:45:39 +00:00
Denis Vlasenko
f2fffd0014 hush: remove env builtin (it is buggy). Add comments 2007-05-02 23:39:04 +00:00
Denis Vlasenko
d01ff13454 hush: simplify debugging prints a little bit 2007-05-02 21:40:23 +00:00
Denis Vlasenko
4ac530c0ef hush: add debugging for tracing execution,
add FIXME for 'true | exit 3; echo $?' case
2007-05-02 15:35:45 +00:00
Denis Vlasenko
ef36ead370 hush: fix incorrect exitcodes without job control 2007-05-02 15:34:47 +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
e3f2f89891 hush: make job control and interactiveness configurable, part 2 2007-04-28 16:48:27 +00:00
Denis Vlasenko
b81b3df1fa hush: make job control and interactiveness configurable, part 1 2007-04-28 16:48:04 +00:00
Denis Vlasenko
0937be5fa6 hush: make hush properly detect EOF on stdin (even interactive one -
think about pty being destroyed) and exit.
2007-04-28 16:47:08 +00:00
Denis Vlasenko
b5eaabb322 hush: add Ctrl-C handling to nofork case 2007-04-28 16:45:59 +00:00
Denis Vlasenko
3ac0e00553 hush: better signal handling across ctrl-z 2007-04-28 16:45:22 +00:00
Denis Vlasenko
18e19f2b0d hush: fix nofork + ctrl-Z clobbering of globals 2007-04-28 16:43:18 +00:00
Denis Vlasenko
a6a1785a30 hush: add ctrl-Z handling for nofork'ed case 2007-04-28 16:42:11 +00:00
Denis Vlasenko
1359da6ac7 hush: make Ctrl-Z work (at least sometimes) 2007-04-21 23:27:30 +00:00
Denis Vlasenko
762d35c75f hust: add a comment 2007-04-21 17:28:51 +00:00
Denis Vlasenko
52881e9f23 hush: fix more backgrounding bugs. Plenty of them remains still. 2007-04-21 13:42:52 +00:00
Denis Vlasenko
2f1bb36a55 hush: explain why "pipe; exit $?" doesn't show correct exitcode 2007-04-21 10:01:14 +00:00
Denis Vlasenko
87cb2db703 hush: do not print message if killed by signal;
move some functions up before main()
2007-04-21 10:00:01 +00:00
Denis Vlasenko
54e7ffb3a4 hush: begin fixing non-functional job control 2007-04-21 00:03:36 +00:00
Denis Vlasenko
5f786c24e4 hush: small code shrink; style fixes 2007-04-20 08:35:45 +00:00
Denis Vlasenko
d1801a4430 dd: fix skip= parse error (spotted by Dirk Clemens <develop@cle-mens.de>) 2007-04-19 20:08:19 +00:00
Denis Vlasenko
05a6d9cbb2 doc: add README on shell job control 2007-04-19 17:26:34 +00:00
Denis Vlasenko
516a0ca2dc ps: add -o tty and -o rss support
1373      14      24    1411     583 busybox.t1/procps/ps.o
   1462      14      24    1500     5dc busybox.t2/procps/ps.o
2007-04-19 14:46:14 +00:00
Denis Vlasenko
55b2de71d7 hush: remove stray semicolon (should change nothing) 2007-04-18 17:21:28 +00:00
Denis Vlasenko
7d4c44e1b1 shells: remove few statics and duplicated code
(much more of the same remains, alas)
function                                             old     new   delta
doset                                                330     332      +2
warn                                                  53      51      -2
onecommand                                           463     461      -2
ioecho                                                40      38      -2
forkexec                                            1412    1410      -2
err                                                   81      79      -2
setdash                                               59      56      -3
flag                                                   4       -      -4
msh_main                                            1389    1384      -5
eval                                                 388     381      -7
subgetc                                              759     747     -12
static.local                                          14       -     -14
b_adduint                                             70      52     -18
------------------------------------------------------------------------------
(add/remove: 0/2 grow/shrink: 1/10 up/down: 2/-73)            Total: -71 bytes
2007-04-16 22:34:39 +00:00
Denis Vlasenko
ac678ec2f1 style fixes, no code changes 2007-04-16 22:32:04 +00:00
Denis Vlasenko
e471275813 msh: style fixes
shell/README - a place to record things about busybox shells
2007-04-14 15:08:41 +00:00
Denis Vlasenko
5f9468e996 lineedit: nuke two unused variables and code which sets them
applets: do not even try to read config if run by real root
msh: use named constants (O_RDONLY etc) in open() instead of magic numbers,
     other minor code size reduction.
2007-04-14 13:22:09 +00:00
Denis Vlasenko
8a28e620ce lash: recognize and use NOFORK applets
lash,hush: fix kill buglet (didn't properly recognize ESRCH)
2007-04-14 11:16:29 +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
fbf6dea5a2 hush: more style fixes. 2007-04-13 19:56:56 +00:00
Denis Vlasenko
f03dbeda90 hush: comment out and replace bug in set_local_var:
-       if (value == 0 && ++value == 0) {
+       /*if (value == 0 && ++value == 0) ??? -vda */
+       if (value == NULL || value[1] == '\0') {

Style fixes.
2007-04-13 19:55:50 +00:00
Denis Vlasenko
b636d8c18c shell/: add SUSv3 doc for fast & easy reference 2007-04-13 19:44:22 +00:00
Denis Vlasenko
b69f35effe lash: "forking" applets are actually can be treated the same way as "non-forked".
Also save a bit of space on trailing NULL array elements.
2007-04-12 17:10:45 +00:00
Denis Vlasenko
7cced6e574 fix realloc-of-non-malloced pointer, and reduce size while at it 2007-04-12 17:08:53 +00:00
Denis Vlasenko
831a20f512 pass a copy of argv[i] to NOFORK applets (they may permute it etc).
set/save/restore more shared global variables whan call one applet from another
2007-04-12 12:27:32 +00:00
Denis Vlasenko
51742f4bb0 style fixes. No code changes 2007-04-12 00:32:05 +00:00
Denis Vlasenko
50f7f446ec bb_full_fd_action: remove potential xmalloc from NOFORK path
cat: stop using stdio.h opens
libbb: introduce & use open[3]_or_warn
function                                             old     new   delta
open3_or_warn                                          -      54     +54
bb_cat                                               115     144     +29
open_or_warn                                           -      25     +25
unlzma                                              2404    2412      +8
chattr_main                                          334     339      +5
xstrtoul_range_sfx                                   251     255      +4
telnet_main                                         1514    1510      -4
static.opt                                             4       -      -4
qgravechar                                           122     118      -4
fuser_add_pid                                         61      54      -7
fuser_add_inode                                      154     147      -7
writeFileToTarball                                  1542    1534      -8
refresh                                             1156    1148      -8
do_show                                              856     846     -10
read_leases                                          212     200     -12
setup_redirects                                      236     222     -14
iproute_list_or_flush                               1582    1568     -14
read_config                                          427     411     -16
write_leases                                         284     264     -20
hash_file                                            338     318     -20
copy_file                                           1760    1740     -20
do_iproute                                          2610    2588     -22
bb_full_fd_action                                    320     269     -51
open_to_or_warn                                      103      49     -54
fuser_main                                          1660    1596     -64
.rodata                                           131160  131096     -64
------------------------------------------------------------------------------
(add/remove: 2/1 grow/shrink: 4/19 up/down: 125/-423)        Total: -298 bytes
2007-04-11 23:20:53 +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
6398cf477d style fixes, no code changes. 2007-04-11 17:04:29 +00:00
Denis Vlasenko
e4f2d064b0 rename: run_applet_by_name -> run_applet_and_exit 2007-04-11 17:03:19 +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
ff131b980d style fixes. No code changes. 2007-04-10 15:42:06 +00:00
Bernhard Reutner-Fischer
de17ece1db - use skip_non_whitespace() where appropriate 2007-04-10 09:38:35 +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
95cb3263ae msh: smallish code shrinkage; cosmetics 2007-04-09 03:06:34 +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
Bernhard Reutner-Fischer
febe3c4211 - sed -e "s/char[[:space:]]*\*[[:space:]]*argv\[\]/char **argv/g" 2007-04-04 20:52:03 +00:00
Denis Vlasenko
f443bffd3c lash: make -c work; crush buffer overrun and free of non-malloced ptr
(from Mats Erik Andersson <mats.andersson64@comhem.se>)
2007-03-31 11:08:50 +00:00
Denis Vlasenko
6fa8b8e17f lash: style cleanup 2007-03-31 11:07:30 +00:00
Denis Vlasenko
10457b90db make pidfile writing configurable.
[ui]toa_to_buf: change API. No users yet.
2007-03-27 22:01:31 +00:00
Denis Vlasenko
55f30b05ac inetd,ed,msh: data/bss reduction (in mss, more than 9k of it) 2007-03-24 22:42:29 +00:00
Denis Vlasenko
219d14d514 random style fixes (extra spaces deleted) 2007-03-24 15:40:16 +00:00
Denis Vlasenko
5b27fbe990 dc: use common_bufsiz1 for evaluation stack
msh: fix "underscore bug" (a_b=1111 didn't work)
dnsd: openlog(), so that applet's name is logged
2007-03-24 14:06:51 +00:00
Denis Vlasenko
7c139b4778 ash: fix signal handling 2007-03-21 20:17:27 +00:00
Denis Vlasenko
c86e052b81 fix accumulated whitespace and indentation damage 2007-03-20 11:30:28 +00:00
Denis Vlasenko
93ebd4f58d ash: popstackmark is reported trying to pop until NULL
is seen (which isn't possible), prevent this.
2007-03-13 20:55:36 +00:00
Mike Frysinger
67a32adbca add STANDALONE support 2007-03-09 08:25:24 +00:00
Denis Vlasenko
8e858e2700 clean up accumulated whitespace damage 2007-03-07 09:35:43 +00:00
Denis Vlasenko
9431e564aa ash: "here document" testcases 2007-03-05 21:08:29 +00:00
Denis Vlasenko
140644dc1c add ash testcases 2007-03-05 20:46:46 +00:00
Denis Vlasenko
1c660b4bd2 small ash testsuite, adapted from bash
(only a small part of it, actually)
2007-03-05 00:27:50 +00:00
Denis Vlasenko
3af3e5b4b0 ash: cosmetic improvements in error messages 2007-03-05 00:24:52 +00:00
Denis Vlasenko
29e31ddd81 ash: do not use "safe applets" in non-standalone shell 2007-03-03 23:12:17 +00:00
Denis Vlasenko
4222ae440a ash: replace xstrdup (shell shall not die)
grep: fix mis-indented block
2007-02-25 02:37:49 +00:00
Denis Vlasenko
5276402f2c ash: fix compile problems 2007-02-24 13:42:56 +00:00
Denis Vlasenko
f98dc4db7a ash: cleanup part 2.8 2007-02-23 21:11:02 +00:00
Denis Vlasenko
0dec6de38b ash: cleanup part 2.7 2007-02-23 21:10:47 +00:00
Denis Vlasenko
cc5715184b ash: cleanup part 2.6 2007-02-23 21:10:35 +00:00
Denis Vlasenko
2de3d9fbee ash: cleanup part 2.5 2007-02-23 21:10:23 +00:00
Denis Vlasenko
a89150733a ash: cleanup part 2.4 2007-02-23 21:10:06 +00:00
Denis Vlasenko
99eb8500c9 ash: cleanup part 2.3 2007-02-23 21:09:49 +00:00
Denis Vlasenko
fc06f2968b ash: cleanup part 2.2 2007-02-23 21:09:35 +00:00
Denis Vlasenko
5651bfc204 ash: starting second round of cleanups. #1 2007-02-23 21:08:58 +00:00
Denis Vlasenko
bc54cffc83 ash: cleanup part 9 2007-02-23 01:05:52 +00:00
Denis Vlasenko
4d2183bee1 ash: cleanup part 8 2007-02-23 01:05:38 +00:00
Denis Vlasenko
4fe15f3d9e ash: cleanup part 7 2007-02-23 01:05:26 +00:00
Denis Vlasenko
a6704933dd ash: cleanup part 6 2007-02-23 01:05:15 +00:00
Denis Vlasenko
5c67e3ed90 ash: cleanup part 5 2007-02-23 01:05:03 +00:00
Denis Vlasenko
fe1f00a7a7 ash: cleanup part 4 2007-02-23 01:04:50 +00:00
Denis Vlasenko
9650f36210 ash: cleanup part 3 2007-02-23 01:04:37 +00:00
Denis Vlasenko
aa74445514 ash: cleanup part 2 2007-02-23 01:04:22 +00:00
Denis Vlasenko
0c032a49b9 ash: cleanup part 1 2007-02-23 01:03:40 +00:00
Denis Vlasenko
a624c11d5e ash: move ash_main() and helpers to end of ash.c, more fuctions renamed,
superfluous casts from memory allocators removed
2007-02-19 22:45:43 +00:00
Denis Vlasenko
2da584fc4e ash: more renaming and style fixes 2007-02-19 22:44:05 +00:00
Denis Vlasenko
b012b10dbd ash: rearrange code to reduce forward references, rename some functions 2007-02-19 22:43:01 +00:00
Denis Vlasenko
e5570da2cf ash: tiny style fixes 2007-02-19 22:41:55 +00:00
Denis Vlasenko
5cedb75aa7 ash: de-obfuscate code, add 'static' keyword, etc. 2007-02-18 19:56:41 +00:00
Denis Vlasenko
131ae177a7 ash: convert #ifdef CONFIG_ to #if ENABLE_ 2007-02-18 13:00:19 +00:00
Denis Vlasenko
a0f82e928a ash: fix indentation and style. no code changes 2007-02-18 12:35:30 +00:00
Denis Vlasenko
6ca0444420 syslogd: fix "readpath bug" by using readlink instead
libbb: rename xgetcwd and xreadlink
2007-02-11 16:19:28 +00:00
Denis Vlasenko
d244c5eaf8 msh: fix my buglet 2007-02-09 17:30:14 +00:00
Denis Vlasenko
cf787cf3a5 find: support for ! 2007-02-04 17:11:25 +00:00
Denis Vlasenko
06af216528 suppress warnings about easch <applet>_main() having
no preceding prototype
2007-02-03 17:28:39 +00:00
Denis Vlasenko
4c97863109 assorted fixes for bugs found with randomconfig 2007-02-03 03:31:13 +00:00
Denis Vlasenko
1e3b068689 msh: cleaning up for -Wwrite-strings part #4 2007-02-01 01:43:54 +00:00
Denis Vlasenko
6b50f73171 msh: cleaning up for -Wwrite-strings part #3 2007-02-01 01:43:39 +00:00
Denis Vlasenko
489f93ebae msh: cleaning up for -Wwrite-strings part #2 2007-02-01 01:43:16 +00:00
Denis Vlasenko
00ccf95bc8 msh: cleaning up for -Wwrite-strings 2007-02-01 01:39:24 +00:00
Denis Vlasenko
71d8abf30c lash: -Wwrite-strings fixes 2007-01-30 22:44:07 +00:00
Denis Vlasenko
bb81c5831a hush: style fixes 2007-01-30 22:32:09 +00:00
Denis Vlasenko
c72c1ed932 hush: now it's -Wwrite-strings clean 2007-01-30 22:31:26 +00:00
Denis Vlasenko
0c886c65de hush: style fixes 2007-01-30 22:30:09 +00:00
Denis Vlasenko
15d78fb724 hust: -Wwrite-strings fixes 2007-01-30 22:28:21 +00:00
Bernhard Reutner-Fischer
eb10e17b7b - improve spelling 2007-01-29 23:56:13 +00:00
Denis Vlasenko
b6aae0f381 preparatory patch for -Wwrite-strings #2 2007-01-29 22:51:25 +00:00
Denis Vlasenko
703e20235a cleanups: unnecessary casts, unified const_1, eliminate cross-.c file
prototypes (heresy!), add spaces in places like "flags&NETSTAT_CONNECTED",
removed unused #defines, #ifdef -> #if, use uint32_t for ipv4 addrs.
2007-01-22 14:12:08 +00:00
Denis Vlasenko
95fef7071e move shell/cmdedit.c -> libbb/lineedit.c 2007-01-22 09:03:42 +00:00
Denis Vlasenko
38f6319421 cmdedit is not a 'command' editing anymore, it's just editing (generic),
so rename stuff accordingly.
2007-01-22 09:03:07 +00:00
Denis Vlasenko
253ce00296 cmdedit: fix breakage 2007-01-22 08:34:44 +00:00
Denis Vlasenko
b01b4e2a1f cmdedit.h: remove 2007-01-22 08:17:14 +00:00
Denis Vlasenko
6258fd3454 cmdedit: stop playing dirty games with atexit 2007-01-22 07:30:26 +00:00
Denis Vlasenko
8e1c71529c Convert cmdedit into more generic line input facility
(make history and completion optional at runtime).
Use it for fdisk, as an example.
Some unrelated fixes in fdisk are also here.
2007-01-22 07:21:38 +00:00
Denis Vlasenko
00cdbd8fc2 Introduce FEATURE_EDITING_FANCY_KEYS, so that user can disable
less-known keys (e.g. Ctrl-B/E/F)
2007-01-21 19:21:21 +00:00
Denis Vlasenko
5592fac308 cmdedit: more optimizations 2007-01-21 19:19:46 +00:00
Denis Vlasenko
47bdb3ac48 cmdedit: small optimizations 2007-01-21 19:18:59 +00:00
Denis Vlasenko
82b39e83ab sanitize cmdedit a bit (group functions by task etc) 2007-01-21 19:18:19 +00:00
Denis Vlasenko
2f0c0d0b88 Introduce FEATURE_EXEC_PREFER_APPLETS = "re-execute our own
executable if we asked to exec someting with argv[0] == known_applet"
Use it in init. Also respect PATH in init, remove explicit "/sbin" etc
from exec. Patch by Gabriel L. Somlo <somlo@cmu.edu>
2007-01-21 00:41:04 +00:00
Denis Vlasenko
9af7c9d6b6 openvt,getty,vfork_daemon_rexec,mount: tighten up fd cleanup code
(will close all fd's > 2 on daemonization now)
getty: fix "getty -" support, and also do not try to chown/chmod "-"
telnetd: fix "lost ctty" bug
Yet another attempt on saner function names:
bb_sanitize_server_stdio(0/1) -> bb_sanitize_stdio() + bb_daemonize();
2007-01-19 21:19:35 +00:00
Denis Vlasenko
7f0d7ae4f5 fix subtle bug inherited from dash 2007-01-18 01:12:57 +00:00
Denis Vlasenko
f7996f3b70 Trailing whitespace removal over entire tree 2007-01-11 17:20:00 +00:00
Denis Vlasenko
62a6983a81 execute "safe applets" exev if not standalone shell
(patch by "Eric Spakman" <E.Spakman@inter.nl.net>)
2007-01-10 00:24:50 +00:00
Denis Vlasenko
b2abef3e54 stty: fix width of a field for ppc32
sort: fix -u to match coreutils 6.3
msh: compile fix (my fault)
2007-01-01 18:18:04 +00:00
Denis Vlasenko
e27f15615f msh: double "static char line[LINELIM]" etc deleted.
massive amounts of assignments-in-ifs deleted
(some of which were VERY nasty)
2007-01-01 06:00:38 +00:00
Mike Frysinger
57ec574af7 * precision requires the argument be an integer, not size_t 2006-12-28 21:41:09 +00:00
Denis Vlasenko
8f27c34c28 ash: is_safe_applet mustn't affect disabled applets 2006-12-26 21:31:11 +00:00
Denis Vlasenko
666da5e2c6 merge post-1.3.0 fixes 2006-12-26 18:17:42 +00:00
Denis Vlasenko
bf0a201008 style fixes
last xcalloc replaced by xzalloc
2006-12-26 10:42:51 +00:00
Denis Vlasenko
0ee3999d13 random tiny size savings 2006-12-24 15:23:28 +00:00
Denis Vlasenko
f4dff77355 less: implement waiting for input using select(). Rather tricky business.
But we do not read entire input anymore up-front.
2006-12-24 07:14:17 +00:00
Denis Vlasenko
7e46cf748e #define FEATURE_GETUSERNAME_AND_HOMEDIR should be always #defined 2006-12-23 01:21:55 +00:00
Denis Vlasenko
4cccc03768 remove useless casts (type*) xzalloc(...) 2006-12-22 18:37:07 +00:00
Denis Vlasenko
afc9ff99fd removal of commented-out cruft 2006-12-22 00:45:27 +00:00
Denis Vlasenko
0a8a774179 cmdedit: reformat code a bit, no algorithm changes 2006-12-21 22:27:10 +00:00
Denis Vlasenko
d56b47f9a6 fix type character mixup in command completion 2006-12-21 22:24:46 +00:00
Denis Vlasenko
bf66fbc8e2 introduce LONE_CHAR (optimized strcmp with one-char string) 2006-12-21 13:23:14 +00:00
Denis Vlasenko
f58906b646 cmdedit: fix my bug, improve code a bit 2006-12-19 19:30:37 +00:00
Denis Vlasenko
7f1dc21a5d cmdedit: use qsort for sorting command completion results; style fixes 2006-12-19 01:10:25 +00:00
Denis Vlasenko
15b213ef5a su: make /etc/shells check configurable
ash: missing ';'
2006-12-19 00:20:20 +00:00
Denis Vlasenko
7cfecc4b36 xfuncs.c: dietlibc actually HAS fdprintf!
platform.h: define strchrnul for dietlibc
ash: stop using few non-standard functions
2006-12-18 22:32:45 +00:00
Denis Vlasenko
83e5d6f772 A bunch of defined(__GLIBC__) added. static-linking warning expanded 2006-12-18 21:49:06 +00:00
Denis Vlasenko
9f739445cd inline strcmp(s, "-") [actually macro-ize it for now - gcc is too stupid] 2006-12-16 23:49:13 +00:00
Denis Vlasenko
097c324f59 fix remaining survivors of the return(a) cleanup 2006-11-27 16:59:15 +00:00
Denis Vlasenko
d9e15f2068 style cleanup: return(a) -> return a, part 2 2006-11-27 16:49:55 +00:00
Denis Vlasenko
079f8afa0a style cleanup: return(a) -> return a, part 1 2006-11-27 16:49:31 +00:00
Denis Vlasenko
d398ecab9d hunt down improper include <>, make mkswap output 4Gb+ friendly 2006-11-24 15:38:03 +00:00
Denis Vlasenko
fcdb00f735 httpd: LC_TIME locale _must_ be POSIX to httpd! We speak over the net! 2006-11-21 00:09:37 +00:00
Denis Vlasenko
89f0b3486d rodata cleanup. "unable to" == "cannot". -300 bytes 2006-11-18 22:04:09 +00:00
Denis Vlasenko
a7189f01a4 add -Wundef, fix uncovered bugs 2006-11-17 20:29:00 +00:00
Mike Frysinger
3672fe9e91 remove duplicate flag decls 2006-11-15 21:52:10 +00:00
Denis Vlasenko
9d4533ede1 Fix kbuild bugs noticed by Bernhard Fischer <rep.nop@aon.at> 2006-11-02 22:09:37 +00:00
Denis Vlasenko
966ec7c067 #if CONFIG_xxx -> #if ENABLE_xxx 2006-11-01 09:13:26 +00:00
Denis Vlasenko
ddec5af6b0 rename functions to more understandable names 2006-10-26 23:25:17 +00:00
Denis Vlasenko
c6f188def8 silly size savings and capitalization fixes 2006-10-26 00:37:00 +00:00
Denis Vlasenko
d18a3a20db use skip_whitespace where appropriate 2006-10-25 12:46:03 +00:00
Denis Vlasenko
e1a0d486e4 message string changes, mostly for consistency, also -32 bytes in .rodata 2006-10-20 13:28:22 +00:00
Denis Vlasenko
5f03158f66 ash: fix segfault in ash.
patch by walter harms <wharms@bfs.de>
2006-10-16 01:33:16 +00:00
Denis Vlasenko
ea62077b85 add open_read_close() and similar stuff 2006-10-14 02:23:43 +00:00
Denis Vlasenko
2d5ca60bfb bb_get_[chomped]line_from_file wasn't descriptive enough.
Renaming...
2006-10-12 22:43:20 +00:00
Denis Vlasenko
8de82bf84f hush.c: stop using __FILE__ (bad in out-of-tree builds) 2006-10-11 21:38:33 +00:00
Denis Vlasenko
cba9ef5523 fixes from Vladimir Dronnikov <dronnikov@gmail.ru> 2006-10-10 21:00:47 +00:00
Denis Vlasenko
7d219aab70 build system overhaul 2006-10-05 10:17:08 +00:00
Denis Vlasenko
8f8f268cfd bb_applet_name -> applet_name 2006-10-03 21:00:43 +00:00
Denis Vlasenko
67b23e6043 getopt_ulflags -> getopt32.
It is impossible to formulate sane ABI based on
size of ulong because it can be 32-bit or 64-bit.
Basically it means that you cannot portably use
more that 32 option chars in one call anyway...
Make it explicit.
2006-10-03 21:00:06 +00:00
Denis Vlasenko
9275814a9e lots of silly indent fixes 2006-10-03 19:56:34 +00:00
Denis Vlasenko
a959588b80 Yet another silly little byte saving. couldn't -> cannot 2006-09-29 21:30:43 +00:00
Denis Vlasenko
e175ff252f several fixes from openWRT project 2006-09-26 17:41:00 +00:00
Rob Landley
4ef6f647a3 The version checked into the tree is a snapshot of an unifinished applet, and
you just made lots of ">>>>>>> mine" lines show up in my working copy of this.

Please don't do that again.
2006-09-20 21:57:36 +00:00
Denis Vlasenko
9213a9e0f2 whitespace cleanup 2006-09-17 16:28:10 +00:00
Rob Landley
215c61d3c2 Unbreak allbareconfig. 2006-09-15 04:10:05 +00:00
Rob Landley
ef08184d9e Fix warnings. 2006-09-08 17:21:19 +00:00
Rob Landley
3476ad651d Second drop. More infrastructure in place, especially for parsing pipelines.
The minimal version got a couple hundred bytes bigger, partly because it's
broken into more functions but mostly because it now dynamically reallocates
and frees everything with no hard-coded limits.  (I thought about making
that optional, but there's a limit to what I can debug and maintain.  It
should still be reasonably NOMMU friendly, the allocations are small and
short lived, and shouldn't contribute noticeably to long-term memory
fragmentation.)
2006-09-08 16:59:08 +00:00
Rob Landley
02add9e53a Might as well commit this to have the history. It's not linked in to the
applet list yet (and won't be until it can replace lash, I'm not having five
shells in menuconfig at once), but you can build it with scripts/individual
and mostly this is checked in so I can bloatcheck future versions against it
easily....

This is about as small as a shell can get and still be a shell.
2006-09-05 03:22:19 +00:00
Rob Landley
88621d7398 Svn 16007 broke the build under gcc 4.0.3. This fixes up some of the damage
(the e2fsprogs directory is too twisty and evil to easily fix, but I plan
to rewrite it anyway so I'll just bump that up in priority a bit).
2006-08-29 19:41:06 +00:00
Bernhard Reutner-Fischer
d591a360d3 - merge -r15463:15564 from busybox_scratch branch through these changesets:
------------------------------------------------------------------------
r15465 | aldot | 2006-06-21 20:48:06 +0200 (Wed, 21 Jun 2006) | 3 lines

- use CONFIG_BUSYBOX_EXEC_PATH as before it one was broken by a recent revert.
- use xchdir() since all is invain if it fails there anyways, supposedly

------------------------------------------------------------------------
r15466 | aldot | 2006-06-21 20:55:16 +0200 (Wed, 21 Jun 2006) | 2 lines

- adjust docs to take CONFIG_BUSYBOX_EXEC_PATH into account.

------------------------------------------------------------------------
r15467 | aldot | 2006-06-21 21:31:24 +0200 (Wed, 21 Jun 2006) | 18 lines

- partial fallout of my TREE_USED touchup against gcc-4.2: rip unused vars, save
s 144 bytes
   text    data     bss     dec     hex filename
 862434   10156  645924 1518514  172bb2 busybox.old
 862322   10156  645892 1518370  172b22 busybox
function                                             old     new   delta
z_len                                                  4       -      -4
textend                                                4       -      -4
part_nb                                                4       -      -4
insize                                                 4       -      -4
ifile_size                                             4       -      -4
do_link                                                4       -      -4
new_text                                              70      60     -10
ipaddr_list_link                                      33      23     -10
gzip_main                                            898     822     -76
------------------------------------------------------------------------------
(add/remove: 0/6 grow/shrink: 0/3 up/down: 0/-120)           Total: -120 bytes


------------------------------------------------------------------------
r15468 | aldot | 2006-06-21 21:43:05 +0200 (Wed, 21 Jun 2006) | 19 lines

- remove useless global exports
function                                             old     new   delta
rpm_main                                             940    1601    +661
rpm_getstring                                        107     112      +5
rpm_getint                                           148     153      +5
loop_through_files                                   103     106      +3
fileaction_dobackup                                  115     113      -2
fileaction_list                                        5       -      -5
rpm_getcount                                          42       -     -42
extract_cpio_gz                                      161       -    -161
rpm_gettags                                          504       -    -504
------------------------------------------------------------------------------
(add/remove: 0/4 grow/shrink: 4/1 up/down: 674/-714)          Total: -40 bytes

   text    data     bss     dec     hex filename
 862322   10156  645892 1518370  172b22 busybox.old
 862290   10156  645892 1518338  172b02 busybox


------------------------------------------------------------------------
r15555 | aldot | 2006-06-30 14:10:11 +0200 (Fri, 30 Jun 2006) | 22 lines

- shrink syslog a little bit, move a big buffer (for 'line') off the bss, fold s
emaphore stuff into single caller manually.
  stats:
function                                             old     new   delta
logMessage                                           395     427     +32
message                                             1245    1257     +12
opts                                                   -       4      +4
small                                                  1       -      -1
local_logging                                          4       -      -4
doRemoteLog                                            4       -      -4
circular_logging                                       4       -      -4
syslogd_main                                        1299    1285     -14
static.res                                            36      16     -20
.rodata                                           186650  186586     -64
static.line                                         1025       -   -1025
------------------------------------------------------------------------------
(add/remove: 1/5 grow/shrink: 2/3 up/down: 48/-1136)        Total: -1088 bytes
cow@s37:~/src/busybox_scratch$ size sysklogd/syslogd.o{.orig,}
   text    data     bss     dec     hex filename
   3723     348    5242    9313    2461 sysklogd/syslogd.o.orig
   3697     348    4188    8233    2029 sysklogd/syslogd.o

==============================================================================
Overall bloatcheck for the changeset mentioned above:
function                                             old     new   delta
rpm_main                                             953    1608    +655
logMessage                                           395     427     +32
message                                             1245    1257     +12
opts                                                   -       4      +4
rpm_getstring                                        107     110      +3
rpm_getint                                           148     151      +3
loop_through_files                                   103     104      +1
small                                                  1       -      -1
fileaction_dobackup                                  115     113      -2
z_len                                                  4       -      -4
textend                                                4       -      -4
part_nb                                                4       -      -4
local_logging                                          4       -      -4
insize                                                 4       -      -4
ifile_size                                             4       -      -4
do_link                                                4       -      -4
doRemoteLog                                            4       -      -4
circular_logging                                       4       -      -4
fileaction_list                                        5       -      -5
new_text                                              70      60     -10
ipaddr_list_link                                      33      23     -10
clear_bufs                                            31      21     -10
syslogd_main                                        1287    1273     -14
builtin_help                                         190     176     -14
static.res                                            36      16     -20
builtin_source                                       229     199     -30
rpm_getcount                                          42       -     -42
gzip_main                                            842     786     -56
.rodata                                           227176  227112     -64
lash_main                                            609     527     -82
busy_loop                                           3883    3739    -144
extract_cpio_gz                                      155       -    -155
rpm_gettags                                          501       -    -501
static.line                                         1025       -   -1025
------------------------------------------------------------------------------
(add/remove: 1/15 grow/shrink: 6/12 up/down: 710/-2221)     Total: -1511 bytes
2006-08-20 17:35:13 +00:00
Rob Landley
a299efb7b0 Make a warning go away when standalone shell is disabled. 2006-08-10 21:46:43 +00:00
Rob Landley
081e38483e Remove xcalloc() and convert its callers to xzalloc(). About half of them
were using "1" as one of the arguments anyway, and as for the rest a multiply
and a push isn't noticeably bigger than pushing two arguments on the stack.
2006-08-03 20:07:35 +00:00
Rob Landley
d921b2ecc0 Remove bb_ prefixes from xfuncs.c (and a few other places), consolidate
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only
had one user), clean up lots of #includes...  General cleanup pass.  What I've
been doing for the last couple days.

And it conflicts!  I've removed httpd.c from this checkin due to somebody else
touching that file.  It builds for me.  I have to catch a bus.  (Now you know
why I'm looking forward to Mercurial.)
2006-08-03 15:41:12 +00:00
Rob Landley
53702e53ba Replace the previous checkin with the correct fix. 2006-07-19 21:43:53 +00:00
"Robert P. J. Day"
3e4da920bd For now, get around the error that "child" might be uninitialized. 2006-07-18 12:05:43 +00:00
Rob Landley
534374755d Cleaup read() and write() variants, plus a couple of new functions like
xlseek and fdlength() for the new mkswap.
2006-07-16 08:14:35 +00:00
Rob Landley
c9c1a41c58 A couple things that got tangled up in my tree, easier to check in both than
untangle them:

Rewrite u_signal_names() into get_signum() and get_signame(), plus trim the
signal list to that required by posix (they can specify the numbers for
the rest if they really need them).  (This is preparatory cleanup for adding
a timeout applet like Roberto Foglietta wants.)

Export the itoa (added due to Denis Vlasenko, although it's not quite his
preferred implementation) from xfuncs.c so it's actually used, and remove
several other redundant implementations of itoa and utoa() in the tree.
2006-07-12 19:17:55 +00:00
Rob Landley
acf448d4f6 Bugfix from Shaun Jackman (check that argv[optind] isn't null before
dereferencing it) plus a bunch of tweaks from me.
2006-07-09 17:03:07 +00:00
Rob Landley
f296f0b77d Bug fix from Vladimir Oleynic via Paul Fox for:
echo "+bond0" > /sys/class/net/bonding_masters
while true; do
  echo hello
done
2006-07-06 01:09:21 +00:00
"Robert P. J. Day"
4eddb42bbc Remove the silly redundancy from that header file include. 2006-07-03 00:46:47 +00:00
"Robert P. J. Day"
63fc1a9e08 Standardize on the vi editing directives being on the first line. 2006-07-02 19:47:05 +00:00
Rob Landley
7a8e491dff Patch from Shaun Jackman moving the var=value logic to here it can do some good. 2006-07-01 17:19:02 +00:00
"Robert P. J. Day"
177c9f3128 Get rid of all "#if 0" content. 2006-07-01 14:30:28 +00:00
"Robert P. J. Day"
68229837ff Remove all usage of the "register" storage class specifier. 2006-07-01 13:08:46 +00:00
"Robert P. J. Day"
f350160963 Remove "#if 1" directives. 2006-07-01 12:19:39 +00:00
Mike Frysinger
42705abc28 dont setpgrp() for now as it breaks system() and that is more important than ctrl+c handling of background processes 2006-06-26 20:42:36 +00:00
Bernhard Reutner-Fischer
f087798e8b - convert old-style parameter declarations (K&R) to modern style. 2006-06-25 22:08:53 +00:00
Bernhard Reutner-Fischer
35492137f8 - add note about strict ordering 2006-06-21 18:19:53 +00:00
Mike Frysinger
c2ad4f5d27 Jean Wolter writes: ash uses bsearch to search in the list of built-in commands, therefore the list of built-in commands has to be ordered. Revision 15077 introduced the source built-in and destroyed this order. And now ash doesn't find the shift command anymore. 2006-06-21 18:04:49 +00:00
Rob Landley
5483de1cb7 Cleanup patch from Shaun Jackman converting %m to perror. 2006-06-20 21:35:26 +00:00
Mike Frysinger
14ff19b28a assign default debug level to the MSHDEBUG define 2006-06-20 20:37:01 +00:00
Rob Landley
7a260f01ce Make some 64 bit warnings go away on x86-64. 2006-06-19 03:20:03 +00:00
Rob Landley
a34b48abe5 Upgrade the standalone shell code to use CONFIG_BUSYBOX_EXEC_PATH. 2006-06-14 01:27:01 +00:00
Rob Landley
68286770b6 Patch from Shaun Jackman to detect "name=value" variable assignments. Random
cleanup at the end by me to make some unrelated #ifdefs go away...
2006-06-13 19:01:30 +00:00
Rob Landley
f946379599 Make lash smaller. (Use llist_t for file closing, and different allocation
functions.)
2006-06-13 18:50:20 +00:00
Paul Fox
7ba12c6957 remove leading "Enable" from the config option text. not only is it
redundant, but it made the menuconfig shortcut mechanism mostly
useless, since so many of the entries started with 'E'.
2006-06-08 21:48:47 +00:00
Paul Fox
6ab037872f made "test" an ash built-in.
moved the contents of libbb/bb_echo.c back into coreutils/echo.c,
which is a more reasonable place for them than libbb.  this
forces anyone who wants echo and test to be builtin to ash to
also have them available as applets.  their cost is very small,
and the number of people who wouldn't want them as applets is
also very small.

added warning about shell builtins vs. CONFIG_FEATURE_SH_STANDALONE_SHELL,
which conflicts with their use.

thanks to nathanael copa for debugging help.

some string size optimization in test.c may have been lost with
this commit, but this is a good new baseline.
2006-06-08 21:37:26 +00:00
Bernhard Reutner-Fischer
19008b8373 - reuse strings and messages. Saves about 600B 2006-06-07 20:17:41 +00:00
Mike Frysinger
2a13175440 make the default prompt suck less when using fancy prompts 2006-06-06 06:26:12 +00:00
Bernhard Reutner-Fischer
62558765b9 2006-06-02 Shaun Jackman <sjackman@gmail.com>
* shell/lash.c (pseudo_exec) [_NEWLIB_VERSION]: Remove the
	__getopt_initialized hackery.
2006-06-03 10:28:25 +00:00
Bernhard Reutner-Fischer
e15d7573a1 - move #include busybox.h to the very top so we pull in the config
and eventual platform specific includes in early.
2006-06-02 20:56:16 +00:00
Mike Frysinger
3132e9d830 use xmalloc() 2006-06-02 06:30:30 +00:00
Rob Landley
299a6b4d7b Consolidate #include <sys/time.h> so libbb.h does it. 2006-05-27 21:42:58 +00:00
Bernhard Reutner-Fischer
b180e5a766 - use portability wrapper define bb_setpgrp. 2006-05-26 14:24:56 +00:00
Bernhard Reutner-Fischer
0a8812bdc5 - replace _PATH_DEVNULL with bb_dev_null 2006-05-19 13:12:21 +00:00
Mike Frysinger
39440e520c pull Rules.mak from top_srcdir as pointed out by Robert P. J. Day on the mailing list 2006-05-13 02:33:09 +00:00
Rob Landley
47b1838957 Patch from Lucas C. Villa Real adding "source" as a synonym for the "." command. 2006-05-12 20:44:16 +00:00
Mike Frysinger
1781188a9d didnt mean to commit debug enable 2006-05-05 20:33:07 +00:00
Mike Frysinger
02d8fa48ad use %p when printing pointers, not %x 2006-05-05 20:32:31 +00:00
Mike Frysinger
4e512f1062 fix Bug 659 as reported by Robin Getz 2006-05-05 18:38:07 +00:00
Rob Landley
2ec922eed5 Patch from Robert P Day: let menuconfig indent stuff for us, we don't have
to do it in Config.in.
2006-04-13 23:22:16 +00:00
Bernhard Reutner-Fischer
df10094870 - revert back to r14406 2006-03-13 19:04:00 +00:00
Rob Landley
bc68cd14cc Patch from Denis Vlasenko turning static const int (which gets emitted into
the busybox binary) into enums (which don't).
2006-03-10 19:22:06 +00:00
Bernhard Reutner-Fischer
07a79e75f5 - backout using features which are not available with the previous stable
version of make (3.71.1).
2006-03-09 09:03:37 +00:00
Paul Fox
0f2dd9f4eb vi-mode changes: eliminate warnings from out-of-range-for-type
case labels that are emitted by gcc4.  rearrange macros to
eliminate these extra case labels entirely (since the optimizer
may no longer do it for us).  eliminate static BUFSIZ character
deletion buffer -- malloc it, and make it much much smaller.
2006-03-07 20:26:11 +00:00
Rob Landley
dfba741457 Robert P. Day removed 8 gazillion occurrences of "extern" on function
definitions.  (That should only be on prototypes.)
2006-03-06 20:47:33 +00:00
Rob Landley
06ec8cff83 Typo fixes brought to you by the letters a, l, and Robert P. Day. 2006-03-03 19:02:50 +00:00
Bernhard Reutner-Fischer
022eb311d5 - use absolute path for top_builddir and top_srcdir.
Fixes make trying to include the very same file in an endless loop.
2006-03-02 17:33:25 +00:00
Bernhard Reutner-Fischer
5d26126b9e - fixes parallel builds (make -j)
- use less resources for the buildsystem itself
2006-03-01 22:54:48 +00:00
Rob Landley
75cc0cace3 I was playing around with a dependency generator a couple weeks ago and I found
some #include files that aren't in the tree.  No biggie...
2006-02-24 03:15:34 +00:00
Rob Landley
d6e14d8bee Don't build directory libraries unless we're building an applet that needs it.
Cherry-picked from Devin Bayer's big MacOS X patch.
2006-02-21 19:11:35 +00:00
"Vladimir N. Oleynik"
dd1ccddf1b moved BB_BANNER to applets/version.c file: make kernel like version,
removed depend loop: busybox.h depend with BB_BT, and all sources depend with busybox.h
2006-02-16 15:40:24 +00:00
Rob Landley
32251b4825 Convert some help text to english. 2006-02-08 18:34:21 +00:00
Mike Frysinger
b38673fb9f make the build system puuuuuuuuuuurty 2006-02-02 01:41:53 +00:00
"Vladimir N. Oleynik"
4ccd2b4697 quick analize signed->unsigned: protect overflow of map[char], getchar->EOF. Use ATTRIBUTE_UNUSE. 2006-01-31 09:27:48 +00:00
Eric Andersen
a68ea1cb93 fix up yet more annoying signed/unsigned and mixed type errors 2006-01-30 22:48:39 +00:00
Rob Landley
49576c0018 Note on SVN 13424: Don't mix "default y" and select of something earlier
in the menu hierarchy or else make allnoconfig winds up leaving whatever the
select  points to as "y".  (In this case, "make allnoconfig" is leaving 
CONFIG_TEST as "y".)
2006-01-30 06:11:42 +00:00
"Vladimir N. Oleynik"
84005af7ef C99 say: "char" declaration may be signed or unsigned default 2006-01-25 17:53:04 +00:00
"Vladimir N. Oleynik"
fdb871c498 Add more bash-like dot-dirs cmdedit feature
Close bug 648.
Restore my whitespace
2006-01-25 11:53:47 +00:00
Tim Riker
c1ef7bdd8d just whitespace 2006-01-25 00:08:53 +00:00
Bernhard Reutner-Fischer
86f5c9906b - add platform.h.
- use shorter boilerplate while at it.
2006-01-22 22:55:11 +00:00
Bernhard Reutner-Fischer
96002bba67 - cleanup Config.in. Use "select CONFIG_FOO" and add the corresponding
"depends on CONFIG_BAR" instead of the if !CONFIG_FOO ...default y stanza.
2006-01-19 14:42:23 +00:00
"Vladimir N. Oleynik"
cfc8f59649 restore 8-bit syntax works, last debian patch is broken. Noticed by Vladimir Dronnikov 2006-01-19 11:23:34 +00:00
"Vladimir N. Oleynik"
fb29b46201 sync with dash_0.5.3-1 2006-01-15 14:21:01 +00:00
Bernhard Reutner-Fischer
7ca61b6f33 - shared libbusybox.
- IMA compilation option (aka IPO, IPA,..)
Please holler if i broke something..
2006-01-15 14:04:57 +00:00
"Vladimir N. Oleynik"
ddc280ec43 sync license from mainstream 2005-12-15 12:01:49 +00:00
"Vladimir N. Oleynik"
e6d88ea2a1 remove sigsetmask, noticed by Bernhard 2005-12-13 13:24:23 +00:00
Rob Landley
032e2cbf20 Uninitialized variable causing intermittent syntax errors (bug 449). 2005-12-12 06:52:45 +00:00
"Vladimir N. Oleynik"
485d7cbdf1 data --> text 2005-10-17 09:48:57 +00:00
"Vladimir N. Oleynik"
6f347ef9dc common BUFSIZ BSS buffer, small reduce code, data and bss 2005-10-15 10:23:55 +00:00
"Vladimir N. Oleynik"
6c35c7c976 usage bb_dev_null 2005-10-12 15:34:25 +00:00
"Vladimir N. Oleynik"
39a841cecf change interface to bb_xasprintf() - more perfect for me.
ln.c: error_msg(str)->error_msg(%s, str) - remove standart "feature" for hackers
reduce 100 bytes don't care in sum
2005-09-29 16:18:57 +00:00
"Vladimir N. Oleynik"
11d7c52912 correct set prompt if CONFIG_ASH_EXPAND_PRMT enabled, small automatic space->tabs convert by my personal editor 2005-09-26 13:24:45 +00:00
Mike Frysinger
62f18e1f20 use the shorter license header 2005-09-24 07:16:29 +00:00
Mike Frysinger
0d4ee68be5 use brief license line 2005-09-24 06:01:57 +00:00
Mike Frysinger
9ac178ab40 rename menu and touchup whitespace 2005-09-24 05:49:36 +00:00
"Vladimir N. Oleynik"
ac9731704a Reduce exported from msh applet 2005-09-22 14:38:17 +00:00
"Vladimir N. Oleynik"
264e771b8b Reduce exported from lash applet 2005-09-22 14:35:29 +00:00
"Vladimir N. Oleynik"
19c370167a Reduce exported from hush applet 2005-09-22 14:33:15 +00:00
"Vladimir N. Oleynik"
e4baaa2d27 more remove lost exported 2005-09-22 12:59:26 +00:00
Paul Fox
02eb934b0f committing:
Summary      0000242: ash: read -t broken
this also implements -n and -s options to read.  (they're configured
together because most of their code is in common, and separating them
seemed silly.
2005-09-07 16:56:02 +00:00
"Vladimir N. Oleynik"
f087480da1 destroy bug [0000404] 2005-09-05 15:46:26 +00:00
"Vladimir N. Oleynik"
bef14d7a87 1) sync with dash_0.5.2-7
2) but expand PS# as config option
3) correct kill error message again
4) remove show "line number" for interactive run (patch pending for dash)
2005-09-05 13:25:11 +00:00
Rob Landley
23246f39ed Patch from Stephane Billiart to improve ash error message. 2005-08-14 19:16:51 +00:00
Paul Fox
0b62158475 implemented a builtin echo command in ash. moved the guts of the
echo applet into libbb, and now call bb_echo() from both echo.c
and ash.c
2005-08-09 19:38:05 +00:00
Paul Fox
3f11b1bf63 commiting:
0000025: vi-editing mode for ash
2005-08-04 19:04:46 +00:00
Mike Frysinger
4d00896d05 use toplevel ARFLAGS and update default ARFLAGS to be quiet 2005-07-27 01:09:24 +00:00
Paul Fox
8de331def0 revert 10881, and refix by changing "if (vallen)" to "if (val)". this
is per the upstream fix for dash, in dash_0.5.2-6.diff.  thanks vodz, for
catching this.
2005-07-21 12:03:05 +00:00
Paul Fox
6f267f022f applying fix for:
0000261: Unsafe empty env var export in ash
2005-07-20 19:18:45 +00:00
Paul Fox
54690dc0b2 applyinf fix for:
0000155: variable expansion with braces in backticks in msh
2005-07-20 18:33:12 +00:00
Paul Fox
c3850c83d9 applying fix from:
0000152: ash: quoting rules for local variables different to globals
2005-07-20 18:23:39 +00:00
Paul Fox
574fee4f99 applying:
0000054: Tab completing filenames in ash causes SEGV
	Simple tab completion operations cause busybox (ash) to
	access illegal addresses.
2005-07-19 20:41:06 +00:00
Rob Landley
0fcd9430ce This one's from me. Fix ash "standalone shell".
If we exec /proc/self/exe and only fall back to /bin/busybox if /proc isn't
there, then we have a reasonable chance of having the standalone shell work
even if busybox isn't installed in /bin on the system in question.

Still won't work in a chroot environment, but it's an improvement.
2005-05-07 08:27:34 +00:00
Mike Frysinger
dcc40b7ecc Shaun Jackman writes: Newlib uses both __getopt_initialized and optind to track initialization of getopt() 2005-03-04 01:33:17 +00:00
Ned Ludd
d1e3cbdb5a - no need to check if JOBS is defined. Config.in ensures it. 2005-02-10 00:44:31 +00:00
Ned Ludd
2123b7cded - add ash read -t timeout support. initial code provided by Tim Yamin on Oct/21/2004 on the busybox mailing list. Edited his code a little to keep syntax highlighers happy and make it optional when CONFIG_ASH_TIMEOUT is defined 2005-02-09 21:07:23 +00:00
Eric Andersen
ad63cb2514 Fix CONFIG_ASH_MATH_SUPPORT_64 so it actually works 2004-10-08 09:43:34 +00:00
Eric Andersen
c00e11df85 Hiroshi Ito writes:
ash
   "unset OLDPWD; cd -"  causes segmentation fault.
    ( OLDPWD is not set when sh is invoked from getty. )

patch against current CVS is attached.
2004-10-08 08:14:58 +00:00
Eric Andersen
7daa076d3e egor duda writes:
Hi!

I've created a patch to busybox' build system to allow building it in
separate tree in a manner similar to kbuild from kernel version 2.6.

That is, one runs command like
'make O=/build/some/where/for/specific/target/and/options'
and everything is built in this exact directory, provided that it exists.

I understand that applyingc such invasive changes during 'release
candidates' stage of development is at best unwise. So, i'm currently
asking for comments about this patch, starting from whether such thing
is needed at all to whether it coded properly.

'make check' should work now, and one make creates Makefile in build
directory, so one can run 'make' in build directory after that.

One possible caveat is that if we build in some directory other than
source one, the source directory should be 'distclean'ed first.

egor
2004-10-08 07:46:08 +00:00
Glenn L McGrath
53090cdedd Fix a typo 2004-09-24 09:09:44 +00:00
Eric Andersen
6f8542b98d A bit of extra explanation regarding STANDALONE 2004-09-24 01:25:39 +00:00
Eric Andersen
4a79c0e9e1 Patrick Huesmann noticed BusyBox would not link when
CONFIG_FEATURE_COMMAND_EDITING was defined *and*
CONFIG_FEATURE_COMMAND_TAB_COMPLETION was undefined.

Vladimir N. Oleynik writes:

Its declare always, also if CONFIG_FEATURE_COMMAND_TAB_COMPLETION
undefined.
Patch to CVS version attached.

--w
vodz
2004-09-08 10:01:07 +00:00
Eric Andersen
fd7a4c8c28 Jonas Holmberg from axis dot com writes:
This patch makes msh handle variable expansion within backticks more
correctly.

Current behaviour (wrong):
--------------------------

BusyBox v1.00-rc3 (2004.08.26-11:51+0000) Built-in shell (msh)
Enter 'help' for a list of built-in commands.

$ A='`echo hello`'
$ echo $A
`echo hello`
$ echo `echo $A`
hello
$


New behaviour (correct):
------------------------

BusyBox v1.00-rc3 (2004.08.26-11:51+0000) Built-in shell (msh)
Enter 'help' for a list of built-in commands.

$ A='`echo hello`'
$ echo $A
`echo hello`
$ echo `echo $A`
`echo hello`
$

The current behaviour (wrong according to standards) was actually my
fault. msh handles backticks by executing a subshell (which makes it
work on MMU-less systems). Executing a subshell makes it hard to only
expand variables once in the parent. Therefore I export all variables
that will be expanded within the backticks and let the subshell handle
the expansion instead.

The bug was found while searching for security leaks in CGI-scripts.
Current behaviour of msh makes it easy to expand backticks by mistake
in $QUERY_STRING. I recommend appling the patch before release of bb
1.00.

/Jonas
2004-09-02 23:13:10 +00:00
Eric Andersen
785001468d Quiet a few warnings 2004-08-27 19:55:28 +00:00
Eric Andersen
cb01bb1d68 Patch from Vladimir N. Oleynik:
On Wed Aug 18, 2004 at 06:52:57PM +0800, Matt Johnston wrote:
> I've come across some strange-seeming behaviour when running programs
> under Busybox (1.0.0-rc3) ash. If the child process sets stdin to be
> non-blocking and then exits, the parent ash will also exit. A quick strace
> shows that a subsequent read() from stdin returns EAGAIN (as would be
> expected):

Thanks!
Patch attached.


--w
vodz
2004-08-19 18:22:13 +00:00
Eric Andersen
acd647c877 Joe.C writes:
This bug is in busybox 1.0.0-rc2. When using lash exec
builtin with redirection, the opened file fd keep increasing.
For example, please try the following command with lash.


ls -al /proc/<lash pid>/fd
exec /bin/sh 2>/dev/null
ls -al /proc/<lash pid>/fd

  The last 'ls' command output will look like this. The fd
number 4 shouldn't exist.

lrwx------    1 501      100         64 Aug 13 13:56 4 -> /dev/pts/5
l-wx------    1 501      100         64 Aug 13 13:56 2 -> /dev/null
lrwx------    1 501      100         64 Aug 13 13:56 1 -> /dev/pts/5
lrwx------    1 501      100         64 Aug 13 13:56 0 -> /dev/pts/5
dr-xr-xr-x    3 501      100          0 Aug 13 13:56 ..
dr-x------    2 501      100          0 Aug 13 13:56 .

  This one-line patch fix this problem by setting CLOEXEC flag for
squirrel fd. Please apply.

Joe.C
2004-08-16 08:38:34 +00:00
Glenn L McGrath
2f325a030b Patch from Tito to fix warnings about redifined functionions barrier and likely. 2004-08-06 01:49:04 +00:00
Eric Andersen
12de6cf0d7 Michael Leibow, MichaelLe at belkin.com writes:
A question was posted a month ago by Mark Alamo to see if others had
problems with sourcing subscripts within msh.  We asked his firm to fix the
msh.c bug he described because we didn't have enough time to do it
ourselves.

When msh.c is executing a compound statement and there is a . command to
source another script file, msh.c will not execute the subscript until it's
completed executing the rest of the compound statement.

His example was this:

Echo "Start" ; . ./subA; echo "mid" ; . ./subB ; echo "end"

subA and subB execute AFTER end is printed in reverse order.  The same is
true if the sourced files are inside an if else fi, case esac, or any
compound statement.

Attached is a patch to msh.c.  It fixes the problem.  Cd to the root of your
busybox tree and execute "patch -p1 < msh.c.patch"

Unfortunately, I won't have more time to work on this so I hope that there
aren't any problems!

Michael Leibow
Senior Software Engineer

Belkin Corporation
2004-08-04 19:19:10 +00:00
Eric Andersen
8401eeafd6 Run msh through indent 2004-08-04 19:16:54 +00:00
Eric Andersen
5dcf15e02d Paul Whittaker writes:
With job control enabled, ash fails to tcsetpgrp back to initialpgrp
upon exit.  exitshell() should call setjobctl(0) to do this.

Context: I am using a lightweight menu system (replimenu[.sf.net]) on my
console, which invokes "/bin/sh -i -c /bin/login", where /bin/sh and
/bin/login are busybox applets.   /bin/sh is ash, with
CONFIG_ASH_JOB_CONTROL=y as the sole suboption.  The shell of the user
concerned (nobody) is also /bin/sh (ash).  When the user /bin/sh exits
(and thereby login and its parent sh), replimenu receives EIO when it
tries to read from the terminal.
2004-07-24 12:44:13 +00:00
Glenn L McGrath
28939ade2d Patch from Jean Wolter, fixes compiler warning when ASH_ALIAS is
disabled.
2004-07-21 10:20:19 +00:00
Glenn L McGrath
5f2a23c3c6 Fix compile error when math support disabled. 2004-06-25 07:05:13 +00:00
Eric Andersen
fac312d78b Stupidity-1, Erik-0 2004-06-22 20:09:40 +00:00
Eric Andersen
e983584c70 Bastian Blank notices a couple of int64_ts that should have
been longs
2004-06-22 19:07:21 +00:00
Eric Andersen
ed9ecf7894 Patch from Bastian Blank:
The updated patch adds a config option to explicitely enable 64 bit
    arithmetic.

    Also it removes the arith prototype from libbb.h as it is not used
    outside of ash.

    Bastian

this patch has been slightly modified by Erik for cleanliness.
2004-06-22 08:29:45 +00:00
Eric Andersen
aff114c33d Larry Doolittle writes:
This is a bulk spelling fix patch against busybox-1.00-pre10.
If anyone gets a corrupted copy (and cares), let me know and
I will make alternate arrangements.

Erik - please apply.

Authors - please check that I didn't corrupt any meaning.

Package importers - see if any of these changes should be
passed to the upstream authors.

I glossed over lots of sloppy capitalizations, missing apostrophes,
mixed American/British spellings, and German-style compound words.

What is "pretect redefined for test" in cmdedit.c?

Good luck on the 1.00 release!

      - Larry
2004-04-14 17:51:38 +00:00
Eric Andersen
99fcd168cc Wolfgang Denk writes:
He,

there is a bug in HUSH's handling of "if" / "elif" commands:

        $  if true
        > then
        > echo 1
        > elif
        > true
        > then
        > echo 2
        > elif
        > true
        > then
        > echo 3
        > else
        > echo 4
        > fi
        1
        2
        3
        $

The same bug exists in all versions of HUSH from BB v0.60.x up to and
including v1.00-pre9. The attached patch fixes this:

        $ if true
        > then
        > echo 1
        > elif
        > true
        > then
        > echo 2
        > elif
        > true
        > then
        > echo 3
        > else
        > echo 4
        > fi
        1
        $



Best regards,

Wolfgang Denk
2004-04-12 21:41:29 +00:00
Eric Andersen
1e6aba967c Peter Milne writes:
Just upgraded from 0.6 to 1.00-pre8

Dot command handling handled args correctly (same as bash) in 0.60,
but failed in 1.00:

I fixed this by reverting the dotcmd function back to previous 0.60
instantiation,
please consider using the older version.

Thanks


Peter
2004-04-12 19:12:13 +00:00
Eric Andersen
e3efc9230c Jamie Guinan writes:
It looks like latest uClibc defines ARCH_HAS_MMU, but a few busybox files
test UCLIBC_HAS_MMU, resulting in vfork() getting called instead of
fork(), etc.

Patch below.   Only tested for lash.

Cheers,
-Jamie
2004-04-12 17:59:24 +00:00
Eric Andersen
9b3ce77b07 Fix spelling. "sort of" is two words. 2004-04-12 15:03:51 +00:00
Eric Andersen
075dd81c44 Remove the CONFIG_FEATURE_SH_APPLETS_ALWAYS_WIN option. It was sortof
stupid and didn't work properly anyways.
2004-04-07 09:34:27 +00:00
Eric Andersen
009617f413 Per suggestion by Pawel Sakowski, fix the dash_arith() prototype
to return a long.  We were needlessly truncating to an int.
2004-04-05 13:24:07 +00:00
Eric Andersen
70060d25d2 s/fileno\(stdin\)/STDIN_FILENO/g
s/fileno\(stdout\)/STDOUT_FILENO/g
2004-03-27 10:02:48 +00:00
Eric Andersen
16767e2377 Patch from vodz to fix the dynamic vars patch, which I should not
have checked in.  Vladimir writes:

Your patch have many problem.
1. You always added + time(). This cannot reset RANDOM=value for debuging
with
replay sequential.
2. Hmm. I examine bash 2.04 source. This pseudorandom generator use low bits
of
counter value. You use high bits. This make bad pseudorandom values after
have
0-value. For example, if + time() do remove, your generator always return 0
after
first generate 0.
3. Memory leak per call. Use ash-unlike unecessary bb_strdup function.
4. Unsupport show last $RANDOM value for "set" and "export" command.
5. Bloat code. Busybox-unlike patch - added unstandart feature as default
hardcode.

Last patch attached.

Erik, why you apply Paul patch with have 5-th point problem? :(

Last patch have ash change xwrite() to fresh libbb/bb_full_write interfase
(haved loop after EINTR).


--w
vodz
2004-03-16 05:14:10 +00:00
Eric Andersen
c7bda1ce65 Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
Eric Andersen
d20d37559f Fix some goofy formatting 2004-03-12 22:08:42 +00:00
Eric Andersen
ef02f82bcf Paul Mundt, lethal at linux-sh dot org writes:
Here's a follow-up replacement to the patch I sent earlier, this adjusts some
of the semantics of the dynamic variable setting. Namely, dynamic vars can hook
a set handler (which RANDOM uses to adjust the seed). They'll only lose their
dynamic status if they're unset.

I've used the same approach that bash does to come up with the random number,
mostly just for consistency.

For example:

$ echo $RANDOM
13759
$ echo $RANDOM
20057
$ echo $RANDOM
1502
$ export RANDOM=42
$ echo $RANDOM
24179
$ echo $RANDOM
2046
$ unset RANDOM
$ echo $RANDOM

$ export RANDOM=42
$ echo $RANDOM
42
$
2004-03-11 13:34:24 +00:00
Glenn L McGrath
c45146cf24 Patch by Felipe Kellermann to fix a compiler compatability problem 2004-03-05 12:55:30 +00:00
Glenn L McGrath
7fc504c6f7 Vodz. last_patch_128
- declare applet_using as static from applets.c
- small correction to cmdedit,
   previous version cleared history after Ctrl-C
- small spelling correction (by Friedrich Lobenstock)
2004-02-22 11:13:28 +00:00
Manuel Novoa III
be8a6ae6eb Fix vstype[] to match VS* defines. Patch from OpenWrt by mbm. 2004-02-18 09:40:41 +00:00
Eric Andersen
95b26250a7 oops. Leave the default feature set enbled for now... 2004-02-10 01:30:21 +00:00
Eric Andersen
37032b4d6c Initial effort at disabling job control as well 2004-02-10 01:28:36 +00:00
Eric Andersen
ff9ad47d79 Support disabling pipe and redirect support 2004-02-10 01:07:45 +00:00
Eric Andersen
fa06a77040 Patch from vodz, based on bug report from Richard Kojedzinszky:
Richard,

>I have a problem, which I can reproduce now. I am using pre7 version of
>busybox, and the tab completion works fine. I mean, with an empty command
>line I press the TAB twice, and ash shows me the available commands. But
>when i process the profile file below, as
> $ . /etc/profile
>then it stops working, and the double-tab lists the directories available
>from the cwd, and not the commands. Has someone else meet this problem
>before, or am i doing something wrong?
>
>This is  my '/etc/profile':
>- ---
># System profile
>
>PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
>export PATH
>trap ":" INT QUIT TERM
>
>export PS1="\h \w # "

Thanks. Patch attached.


--w
vodz
2004-02-06 10:33:19 +00:00
Glenn L McGrath
16e45d7e29 Vodz last_patch_125_2, this patch have:
- synced with dash 0.4.21
- better handle trap "cmds..." SIGINT (strange, i make bad hack for ash 
  and cmdedit, but this work only with this...)
- may be haven`t problem with Ctrl-D
2004-02-04 08:24:39 +00:00
Glenn L McGrath
bbbe21d6b0 Fix compile error when tab completion disabled 2004-01-25 08:46:10 +00:00
Glenn L McGrath
475820c9de last_patch_124 from Vodz, fix an ash bug when alt-1 was pressed, debian
bug #228915
2004-01-22 12:42:23 +00:00
Glenn L McGrath
67285965f3 Vodz last_patch_122, Check $PATH at runtime to fix tab completion 2004-01-14 09:34:51 +00:00
Glenn L McGrath
76620620ec Vodz last_patch_121, syncing with dash_0.4.19, reduce code size. 2004-01-13 10:19:37 +00:00
Glenn L McGrath
3b25185733 Declare dependencies of command line editing in the build system 2004-01-03 12:07:32 +00:00
Eric Andersen
27bb79080d Cmdedit update from Vladimir N. Oleynik (vodz) 2003-12-23 20:24:51 +00:00
Glenn L McGrath
4ddddd180e Fix for "Broken pipe" issue, vodz last_patch116_3 2003-11-25 20:45:38 +00:00
Glenn L McGrath
5c2c8eca4a Fix a "broken pipe" problem. vodz, last_patch_116-2 2003-11-14 21:01:26 +00:00
Eric Andersen
a48b0a3af7 last_patch116 from vodz:
Stephane,

>Using busybox+uclibc, crond syslog messages look like:
>
>Oct  9 09:04:46 soekris cron.notice crond[347]: ^Icrond 2.3.2 dillon,
>started, log level 8

Thanks for testing.

>The attached patch corrects the problem.

Your patch is not correct.
Correct patch attached.

Also. Last patch have
- add "Broken pipe" message to ash.c
- busybox ash synced with dash_0.4.18

--w
vodz
2003-10-22 10:56:47 +00:00
Eric Andersen
88c916bdec Andreas Mohr writes:
the busybox menuconfig triggered my "inacceptable number of spelling mistakes"
upper level, so I decided to make a patch ;-)

I also improved some wording to describe some things in a better way.

Many thanks for an incredible piece of software!

Andreas Mohr, random OSS developer
2003-10-22 09:58:56 +00:00
Glenn L McGrath
d3612178b7 Patch by Junio C Hamano to workaround a gcc compiler bug.
The construct certain vintages of GCC (the one I have trouble
with is 3.2.3) have trouble with looks like the following:

    static struct st a;
    static struct st *p = &a;
    struct st { int foo; };
    static void init(void) { a.foo = 0; }

The problem disappears if we move the struct declaration up to
let the compiler know the shape of the struct before the first
definition uses it, like this:

    struct st { int foo; }; /* this has been moved up */
    static struct st a;
    static struct st *p = &a;
    static void init(void) { a.foo = 0; }
2003-09-17 00:22:26 +00:00
Glenn L McGrath
a3822de23e Patch from Bastian Blank to fix a problem when runing find under ash.
"If the shell is compiled with -DJOBS, this is all fine -- find wasn't
stopped (it was killed), so it correctly uses WTERMSIG instead of WSTOPSIG.
However, if the shell _isn't_ compiled with -DJOBS (which it isn't in d-i),
only WSTOPSIG is used, which extracts the high byte instead of the low
byte from the status code.  Since the status code is 13 (SIGPIPE), "st"
suddenly gets the value 0, which is equivalent to SIGEXIT. Thus, ash prints
out "EXIT" on find's exit."
2003-09-15 14:42:39 +00:00
Glenn L McGrath
47e5ca1ecb Patch by Jean Wolter to fix a bug where a script wouldnt be executed
unless it had #!/bin/sh in the first line

"It correctly locates the script, tries to execute it via execve which
fails. After that it tries to hand it over to /bin/sh which fails too,
since ash

    - neither provides the absolute pathname to /bin/sh
    - nor tries to lookup the script via PATH if called as "sh script"
"
2003-09-15 12:00:19 +00:00
Eric Andersen
8efe967018 Be entirely consistant when using ioctl(0, TIOCGWINSZ, &winsize)
to ensure proper fallback behavior on, i.e. serial consoles.
 -Erik
2003-09-15 08:33:45 +00:00
Eric Andersen
f57a614db9 config option CONFIG_FEATURE_SH_APPLETS_ALWAYS_WIN must depend
on CONFIG_FEATURE_SH_STANDALONE_SHELL.
2003-09-12 04:49:21 +00:00
Glenn L McGrath
dc4e75ef7c move all "-/bin/sh" "/bin/sh" and "sh" to libbb/messages.c file as one
constant.
Vodz last_patch_107
2003-09-02 02:36:18 +00:00
Glenn L McGrath
005f83adf5 Fix compile error and reducing size for libbb/get_console.c to previous size.
Vodz last_patch106
2003-09-01 08:53:32 +00:00
Glenn L McGrath
7b8765c808 vodz, last patch 103 2003-08-29 07:29:30 +00:00
Manuel Novoa III
4456f25e8f Rewrite timescmd() function to avoid the use of floating point and to
correct a bug in the seconds display where something like  65 seconds
would be output as "1m65.000000s".
2003-08-13 17:48:47 +00:00
Eric Andersen
b287e2e27a Use the new 'select' option to make the shell config
much less evil and far more obvious.
 -Erik
2003-08-08 23:40:12 +00:00
Eric Andersen
9089844382 Latest dash update from vodz 2003-08-06 11:20:52 +00:00
Eric Andersen
72d8e444f0 Merge/rework config system per the latest from linux-2.6.0-test2.
Fix the config bugs revealed by the updated config system.
 -Erik
2003-08-05 02:18:25 +00:00
Eric Andersen
ca16204c31 Fixup typo noticed by Nick Fedchik 2003-07-29 07:15:17 +00:00
Eric Andersen
81fe123040 Vladimir N. Oleynik writes:
Last patch have synced form Manuel Nova III xxreadtoken() function,
corrected (C) form dash debian/copyright, removed my small mistake
with IFS_BROKEN (thanks by Herbert), and synced cmdedit.c from
current CVS (removed libc5 support, your email correction, my (C) year
corertion).
2003-07-29 06:38:40 +00:00
Eric Andersen
c470f4477a This is synced from dash-0.4.17 and full ready for insert to new busybox
version:
ftp://ftp.simtreas.ru/pub/my/bb/new

News:

- code is smalest!
- support ${var...} expr
- used new very strongly steal controlling terminal
2003-07-28 09:56:35 +00:00
Eric Andersen
3857a184c7 Document CONFIG_ASH_CMDCMD 2003-07-22 10:14:32 +00:00
Eric Andersen
9c3c38da55 Patch from Terje Kvernes adding quite a lot of missing documentation 2003-07-22 09:59:34 +00:00
Eric Andersen
85e5e72bc1 Remove remaining libc5 support code 2003-07-22 08:56:55 +00:00
Eric Andersen
cb81e6484d Update a bunch of docs. Run a script to update my email addr. 2003-07-14 21:21:08 +00:00
Eric Andersen
e5642119ee Patch from Thomas Cameron:
Hello all,
	    This patch adds more "Help" text to the config system.  Almost
    all applets now have a help entry.  Also, I cleaned up the spacing of
    the existing text so that things are consistent.  This patch is against
    this morning's CVS.

    Thomas Cameron
    CEI Systems, Inc.
2003-07-14 19:37:08 +00:00
Eric Andersen
e5920a2dc0 Patch from Kent Robotti adding a bunch of menuconfig help 2003-07-03 10:00:15 +00:00
Manuel Novoa III
cad5364599 Major coreutils update. 2003-03-19 09:13:01 +00:00
Eric Andersen
737f5fb890 Patch from Jonas Holmberg, adjusted by Robert Schwebel, and
later re-adjusted by me to fix msh backtick handling
2003-03-14 16:05:59 +00:00
Eric Andersen
4b525addb8 Only call free if it is necessary 2003-01-14 06:40:11 +00:00
Glenn L McGrath
7040ecc993 Minor cleanup, identified by Stewart Brodie, patch by Vladimir N.
Oleynik
2003-01-06 16:27:07 +00:00
Glenn L McGrath
4d00129d0f Correct column width for tab completion and ls 2003-01-06 01:11:50 +00:00
Eric Andersen
2c24bb80f9 Fix tab-tab listing of files so it properly reflects current
terminal width.
 -Erik
2003-01-02 07:25:47 +00:00