oweals/busybox.git
16 years agoman: yet another fixlet to "manpage link" code
Denis Vlasenko [Tue, 5 Aug 2008 14:15:19 +0000 (14:15 -0000)]
man: yet another fixlet to "manpage link" code

16 years agoman: fixlet for man links
Denis Vlasenko [Tue, 5 Aug 2008 13:45:22 +0000 (13:45 -0000)]
man: fixlet for man links

16 years agoman: add handling of "man links", by Ivana Varekova <varekova AT redhat.com>
Denis Vlasenko [Tue, 5 Aug 2008 13:16:18 +0000 (13:16 -0000)]
man: add handling of "man links", by Ivana Varekova <varekova AT redhat.com>

function                                             old     new   delta
run_pipe                                             102     354    +252
show_manpage                                           -     126    +126
man_main                                             705     615     -90
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/1 up/down: 378/-90)           Total: 288 bytes

16 years ago*: refactor handling of archived files. "tar f file.tar.lzma" now works too.
Denis Vlasenko [Tue, 5 Aug 2008 13:10:34 +0000 (13:10 -0000)]
*: refactor handling of archived files. "tar f file.tar.lzma" now works too.

function                                             old     new   delta
unpack_Z_stream                                        -    1229   +1229
open_zipped                                            -     176    +176
unpack_bz2_stream_prime                                -      60     +60
tar_main                                             642     677     +35
find_main                                            406     418     +12
sv_main                                             1222    1233     +11
decode_format_string                                 829     837      +8
cmp_main                                             641     649      +8
popstring                                            134     140      +6
filter_accept_list_reassign                          120     125      +5
parse_and_put_prompt                                 800     804      +4
passwd_main                                         1053    1049      -4
make_new_name_gunzip                                 119     114      -5
rpm_main                                            1688    1670     -18
prepare                                              302     283     -19
xmalloc_open_zipped_read_close                       135      61     -74
uncompress                                          1229       -   -1229
------------------------------------------------------------------------------
(add/remove: 3/1 grow/shrink: 8/5 up/down: 1554/-1349)        Total: 205 bytes

16 years ago- don't free user-supplied string (via -e)
Bernhard Reutner-Fischer [Tue, 5 Aug 2008 09:56:56 +0000 (09:56 -0000)]
- don't free user-supplied string (via -e)
- fix helptext

function                                             old     new   delta
chpasswd_main                                        300     319     +19
packed_usage                                       24352   24344      -8
.rodata                                           122227  122195     -32
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/2 up/down: 19/-40)            Total: -21 bytes

16 years agowhitespace fixes, no code changed
Denis Vlasenko [Tue, 5 Aug 2008 07:59:25 +0000 (07:59 -0000)]
whitespace fixes, no code changed

16 years agoxargs: fix -e default to match newer GNU xargs, add SUS mandated -E.
Denis Vlasenko [Mon, 4 Aug 2008 21:30:55 +0000 (21:30 -0000)]
xargs: fix -e default to match newer GNU xargs, add SUS mandated -E.
 closes bug 4414

16 years agomodprobe: use buffering line reads (fgets) instead of reads().
Denis Vlasenko [Mon, 4 Aug 2008 21:16:46 +0000 (21:16 -0000)]
modprobe: use buffering line reads (fgets) instead of reads().
libbb: remove reads()

function                                             old     new   delta
include_conf_file_act                                961     980     +19
localcmd                                             282     284      +2
already_loaded                                       155     151      -4
in_cksum                                              58      53      -5
modprobe_main                                       1630    1624      -6
reads                                                129       -    -129
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 2/3 up/down: 21/-144)          Total: -123 bytes

16 years agofix some testsuite false positives
Denis Vlasenko [Mon, 4 Aug 2008 14:40:58 +0000 (14:40 -0000)]
fix some testsuite false positives

16 years agolibbb: make xrealloc_vector zero out the realloc'ed tail
Denis Vlasenko [Mon, 4 Aug 2008 13:20:36 +0000 (13:20 -0000)]
libbb: make xrealloc_vector zero out the realloc'ed tail

function                                             old     new   delta
xrealloc_vector_helper                                51      76     +25
man_main                                             712     705      -7
act                                                  250     234     -16
create_list                                           91      70     -21
getopt_main                                          695     664     -31
load_dep_bb                                          281     248     -33
fileAction                                           744     709     -35
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/6 up/down: 25/-143)          Total: -118 bytes

16 years agohush: fix mishandling of a'b'c=fff as assignments. They are not.
Denis Vlasenko [Mon, 4 Aug 2008 00:46:07 +0000 (00:46 -0000)]
hush: fix mishandling of a'b'c=fff as assignments. They are not.

function                                             old     new   delta
parse_stream                                        1920    2004     +84
done_word                                            715     752     +37
parse_and_run_stream                                 328     333      +5
builtin_exec                                          25      29      +4
pseudo_exec_argv                                     138     139      +1
run_list                                            2006    1999      -7
is_assignment                                        215     134     -81
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 5/2 up/down: 131/-88)            Total: 43 bytes

16 years agohush: remove a comment about already fixed bug
Denis Vlasenko [Sun, 3 Aug 2008 22:27:50 +0000 (22:27 -0000)]
hush: remove a comment about already fixed bug

16 years agomakedevs: shrink by Vladimir
Denis Vlasenko [Sun, 3 Aug 2008 22:14:02 +0000 (22:14 -0000)]
makedevs: shrink by Vladimir

function                                             old     new   delta
makedevs_main                                       1071    1049     -22
packed_usage                                       24744   24708     -36

16 years agossd: fix -K/-S mixup in help text
Denis Vlasenko [Sun, 3 Aug 2008 19:23:30 +0000 (19:23 -0000)]
ssd: fix -K/-S mixup in help text

16 years agoxargs: update help text
Denis Vlasenko [Sun, 3 Aug 2008 19:20:25 +0000 (19:20 -0000)]
xargs: update help text

16 years agoxargs: fix xargs -e; added test for that
Denis Vlasenko [Sun, 3 Aug 2008 19:12:25 +0000 (19:12 -0000)]
xargs: fix xargs -e; added test for that

16 years agohalt: signal init regardless of ENABLE_INIT
Denis Vlasenko [Sun, 3 Aug 2008 18:43:45 +0000 (18:43 -0000)]
halt: signal init regardless of ENABLE_INIT

16 years agonameif: shrink (by Vladimir)
Denis Vlasenko [Fri, 1 Aug 2008 02:32:23 +0000 (02:32 -0000)]
nameif: shrink (by Vladimir)

function                                             old     new   delta
nameif_main                                          668     636     -32

16 years agomakedevs: fix help text discrepancies
Denis Vlasenko [Fri, 1 Aug 2008 02:15:51 +0000 (02:15 -0000)]
makedevs: fix help text discrepancies

16 years agomakedevs: shrink (by Vladimir); testsuite
Denis Vlasenko [Fri, 1 Aug 2008 02:15:05 +0000 (02:15 -0000)]
makedevs: shrink (by Vladimir); testsuite

function                                             old     new   delta
makedevs_main                                       1153    1071     -82

16 years agohush: support $_NUMBERS variable names
Denis Vlasenko [Thu, 31 Jul 2008 10:34:48 +0000 (10:34 -0000)]
hush: support $_NUMBERS variable names

16 years agohush: fix "case ... in <newline> word)..."
Denis Vlasenko [Thu, 31 Jul 2008 10:09:26 +0000 (10:09 -0000)]
hush: fix "case ... in <newline> word)..."

16 years agohush: support "pattern1|pattern2...)" in case statements
Denis Vlasenko [Thu, 31 Jul 2008 00:17:01 +0000 (00:17 -0000)]
hush: support "pattern1|pattern2...)" in case statements

parse_stream                                        1847    1861     +14
run_list                                            1995    2006     +11

16 years agotr: fix yet another access past the end of a string (bug 4374)
Denis Vlasenko [Wed, 30 Jul 2008 22:58:18 +0000 (22:58 -0000)]
tr: fix yet another access past the end of a string (bug 4374)

16 years agochpst: large code shrink by Vladimir
Denis Vlasenko [Wed, 30 Jul 2008 21:23:26 +0000 (21:23 -0000)]
chpst: large code shrink by Vladimir

function                                             old     new   delta
chpst_main                                          1058    1357    +299
euidgid                                               56       -     -56
suidgid                                               59       -     -59
slimit                                               208       -    -208
packed_usage                                       24638   24420    -218
edir                                                 375       -    -375
------------------------------------------------------------------------------
(add/remove: 0/4 grow/shrink: 1/1 up/down: 299/-916)         Total: -617 bytes

16 years agoash: bash compat: "shift $BIGNUM" is equivalent to "shift 1"
Denis Vlasenko [Wed, 30 Jul 2008 15:35:05 +0000 (15:35 -0000)]
ash: bash compat: "shift $BIGNUM" is equivalent to "shift 1"

16 years agohush: trivial code shrink
Denis Vlasenko [Tue, 29 Jul 2008 19:48:30 +0000 (19:48 -0000)]
hush: trivial code shrink

function                                             old     new   delta
builtin_continue                                      48      22     -26

16 years agohush: use G.xxx instead of #define xxx G.xxx. We have too many globals
Denis Vlasenko [Tue, 29 Jul 2008 19:43:10 +0000 (19:43 -0000)]
hush: use G.xxx instead of #define xxx G.xxx. We have too many globals
 there and #defines get messy. Remove one write-only G.variable.

16 years agorandomconfig fix
Denis Vlasenko [Tue, 29 Jul 2008 13:57:59 +0000 (13:57 -0000)]
randomconfig fix

16 years agohush: small fix for repeated continue and fix for wrong loop depth count
Denis Vlasenko [Tue, 29 Jul 2008 13:36:09 +0000 (13:36 -0000)]
hush: small fix for repeated continue and fix for wrong loop depth count
 after Ctrl-C; with testcase for first one

16 years agohush: fix inverted check (was making all break's to act as "break 99999")
Denis Vlasenko [Tue, 29 Jul 2008 11:47:46 +0000 (11:47 -0000)]
hush: fix inverted check (was making all break's to act as "break 99999")

16 years agohush: fix break'ing out of {} and () groups; with testcase
Denis Vlasenko [Tue, 29 Jul 2008 11:37:15 +0000 (11:37 -0000)]
hush: fix break'ing out of {} and () groups; with testcase

function                                             old     new   delta
builtin_break                                         93     129     +36
builtin_continue                                      21      47     +26
run_list                                            1973    1976      +3

16 years agorandomconfig fixes
Denis Vlasenko [Tue, 29 Jul 2008 11:10:01 +0000 (11:10 -0000)]
randomconfig fixes

16 years agohush: add #defines to switch off break/continue if loops are not supported
Denis Vlasenko [Tue, 29 Jul 2008 10:16:05 +0000 (10:16 -0000)]
hush: add #defines to switch off break/continue if loops are not supported
*: remove a few inline keywords
no code changes

16 years agomodprobe: support for /etc/modprobe.d, by Timo Teras.
Denis Vlasenko [Tue, 29 Jul 2008 00:19:44 +0000 (00:19 -0000)]
modprobe: support for /etc/modprobe.d, by Timo Teras.

function                                             old     new   delta
include_conf_file_act                                  -     929    +929
include_conf_recursive                                 -      30     +30
include_conf_file2                                     -      30     +30
include_conf_file                                      -      14     +14
include_conf_dir_act                                   -      14     +14
build_dep                                           1011     875    -136
include_conf                                         922       -    -922
------------------------------------------------------------------------------
(add/remove: 5/1 grow/shrink: 0/1 up/down: 1017/-1058)        Total: -41 bytes

16 years agolibbb: dump: do not use uninitialized memory. close bug 4364.
Denis Vlasenko [Tue, 29 Jul 2008 00:00:14 +0000 (00:00 -0000)]
libbb: dump: do not use uninitialized memory. close bug 4364.

16 years agotr: fix "tr [=" case. Closes bug 4374.
Denis Vlasenko [Mon, 28 Jul 2008 23:49:42 +0000 (23:49 -0000)]
tr: fix "tr [=" case. Closes bug 4374.

function                                             old     new   delta
expand                                              1701    1738     +37
tr_main                                              472     474      +2

16 years agohush: fix "while false; ..." exitcode; add testsuites
Denis Vlasenko [Mon, 28 Jul 2008 23:17:31 +0000 (23:17 -0000)]
hush: fix "while false; ..." exitcode; add testsuites

16 years agohush: support "break N" and "continue N"
Denis Vlasenko [Mon, 28 Jul 2008 23:07:06 +0000 (23:07 -0000)]
hush: support "break N" and "continue N"
 fix non-detection of builtins and applets in "v=break; ...; $v; ..." case
 add testsuite entries for the above

function                                             old     new   delta
builtin_break                                         12      93     +81
run_list                                            1948    1971     +23
builtin_continue                                      12      21      +9
pseudo_exec_argv                                     132     138      +6
builtin_exec                                          23      25      +2
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 5/0 up/down: 121/0)             Total: 121 bytes

16 years agohush: implement break and continue
Denis Vlasenko [Mon, 28 Jul 2008 23:04:34 +0000 (23:04 -0000)]
hush: implement break and continue

function                                             old     new   delta
bltins                                               252     276     +24
builtin_continue                                       -      12     +12
builtin_break                                          -      12     +12
static.version_str                                    18      17      -1
run_list                                            1984    1948     -36
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 1/2 up/down: 48/-27)             Total: 11 bytes

16 years agohush: in run_list(), some loop_top ops seems to be superfluous.
Denis Vlasenko [Mon, 28 Jul 2008 15:17:44 +0000 (15:17 -0000)]
hush: in run_list(), some loop_top ops seems to be superfluous.
 comment them out. Also, use separate temp variable
 for verification loop, helps gcc to optimize better.

function                                             old     new   delta
run_list                                            2039    1984     -55

16 years agohush: in run_list(), last_cond_code seems to be superfluous. comment it out
Denis Vlasenko [Mon, 28 Jul 2008 15:15:59 +0000 (15:15 -0000)]
hush: in run_list(), last_cond_code seems to be superfluous. comment it out

function                                             old     new   delta
run_list                                            2055    2039     -16
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-16)             Total: -16 bytes

16 years agohush: explain run_list() in detail; small optimizations
Denis Vlasenko [Mon, 28 Jul 2008 15:15:09 +0000 (15:15 -0000)]
hush: explain run_list() in detail; small optimizations

function                                             old     new   delta
hush_main                                            785     786      +1
expand_variables                                    1447    1448      +1
builtin_exit                                          48      49      +1
builtin_eval                                          54      55      +1
run_list                                            2075    2055     -20
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/1 up/down: 4/-20)             Total: -16 bytes

16 years agodocumentation fix
Denis Vlasenko [Mon, 28 Jul 2008 00:06:02 +0000 (00:06 -0000)]
documentation fix

16 years agohush: finish and enable optional case...esac support. Code size cost:
Denis Vlasenko [Mon, 28 Jul 2008 00:01:16 +0000 (00:01 -0000)]
hush: finish and enable optional case...esac support. Code size cost:

function                                             old     new   delta
run_list                                            1891    2075    +184
parse_stream                                        1764    1847     +83
expand_strvec_to_string                                -      83     +83
done_word                                            647     715     +68
static.reserved_list                                 144     168     +24
static.reserved_match                                  -      12     +12
done_pipe                                             95     105     +10
builtin_exit                                          48      46      -2
builtin_eval                                         127      54     -73
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 5/2 up/down: 464/-75)           Total: 389 bytes

16 years agofbset: shrink code a bit more
Denis Vlasenko [Sun, 27 Jul 2008 21:16:30 +0000 (21:16 -0000)]
fbset: shrink code a bit more

16 years agofbset: code shrink
Denis Vlasenko [Sun, 27 Jul 2008 20:25:29 +0000 (20:25 -0000)]
fbset: code shrink

function                                             old     new   delta
ss                                                     -      33     +33
fbset_main                                          1968    1844    -124
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/1 up/down: 33/-124)           Total: -91 bytes

16 years agonetstat: code shrink
Denis Vlasenko [Sun, 27 Jul 2008 17:24:19 +0000 (17:24 -0000)]
netstat: code shrink

function                                             old     new   delta
print_inet_line                                        -     193    +193
scan_inet_proc_line                                    -     130    +130
unix_do_one                                          519     503     -16
do_info                                              145      97     -48
netstat_main                                         601     548     -53
tcp_do_one                                           462      61    -401
raw_do_one                                           513     107    -406
udp_do_one                                           533     119    -414
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 0/6 up/down: 323/-1338)       Total: -1015 bytes

16 years agostyle fix, no code changes
Denis Vlasenko [Sun, 27 Jul 2008 14:15:42 +0000 (14:15 -0000)]
style fix, no code changes

16 years agonetstat: optional -p support by L. Gabriel Somlo <somlo AT cmu.edu>
Denis Vlasenko [Sun, 27 Jul 2008 12:10:07 +0000 (12:10 -0000)]
netstat: optional -p support by L. Gabriel Somlo <somlo AT cmu.edu>

Without FEATURE_NETSTAT_PRG:
function                                             old     new   delta
recursive_action                                     416     425      +9
tcp_do_one                                           420     428      +8
udp_do_one                                           492     499      +7
raw_do_one                                           472     479      +7
expand                                              1697    1701      +4
netstat_main                                         489     492      +3
unix_do_one                                          486     488      +2
flags                                                  1       -      -1
qgravechar                                           109     106      -3
net_conn_line                                          4       -      -4
bbunpack                                             391     383      -8
------------------------------------------------------------------------------
(add/remove: 0/2 grow/shrink: 7/2 up/down: 40/-16)             Total: 24 bytes

With FEATURE_NETSTAT_PRG:
file_act                                               -     213    +213
dir_act                                                -     192    +192
netstat_main                                         489     601    +112
prg_cache_get                                          -      50     +50
tcp_do_one                                           420     462     +42
udp_do_one                                           492     533     +41
raw_do_one                                           472     513     +41
unix_do_one                                          486     519     +33
recursive_action                                     416     425      +9
expand                                              1697    1701      +4
flags                                                  1       -      -1
qgravechar                                           109     106      -3
net_conn_line                                          4       -      -4
bbunpack                                             391     383      -8
packed_usage                                       24586   24572     -14
------------------------------------------------------------------------------
(add/remove: 3/2 grow/shrink: 7/3 up/down: 737/-30)           Total: 707 bytes

16 years agowhitespace fix
Denis Vlasenko [Sat, 26 Jul 2008 23:16:33 +0000 (23:16 -0000)]
whitespace fix

16 years agoman: a forgotten chunk of lask commit (config file parser fixes)
Denis Vlasenko [Sat, 26 Jul 2008 23:14:23 +0000 (23:14 -0000)]
man: a forgotten chunk of lask commit (config file parser fixes)

16 years agofix several problems with config parser:
Denis Vlasenko [Sat, 26 Jul 2008 23:08:31 +0000 (23:08 -0000)]
fix several problems with config parser:
 a bug where it underflows the string
 a bug where it never frees parser_t struct
make read_config() return 0 if parser is NULL,
 make config_close() accept and ignore NULL parser -
 eliminates many if() blocks
reverse the sense of parser bit flags - negative flags
 are harder to grok.
hexdump: revert the change to use config parser, it is BIGGER
 and also requires additional quirks in parser
*: explicitly use PARSER_NORMAL instead of 0

function                                             old     new   delta
login_main                                          1575    1596     +21
config_close                                          18      29     +11
bbunpack                                             383     391      +8
qgravechar                                           106     109      +3
rtnl_tab_initialize                                  121     117      -4
expand                                              1697    1693      -4
man_main                                             717     712      -5
nameif_main                                          674     668      -6
hexdump_main                                         597     591      -6
read_config                                          217     209      -8
dnsd_main                                           1478    1470      -8
sysctl_main                                          203     189     -14
config_open2                                          44      25     -19
make_device                                         1177    1141     -36
config_read                                          597     549     -48
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/11 up/down: 43/-158)         Total: -115 bytes

16 years agoman: ignore (not complain) lines with less than 2 tokens
Denis Vlasenko [Sat, 26 Jul 2008 19:44:53 +0000 (19:44 -0000)]
man: ignore (not complain) lines with less than 2 tokens
 in config file

16 years agotr: fix "access past the end of a string" bug 4354
Denis Vlasenko [Sat, 26 Jul 2008 19:34:00 +0000 (19:34 -0000)]
tr: fix "access past the end of a string" bug 4354

16 years agomdev: do not complain if mdev.conf does not exist;
Denis Vlasenko [Sat, 26 Jul 2008 18:35:10 +0000 (18:35 -0000)]
mdev: do not complain if mdev.conf does not exist;
 use #if to prevent gcc from generating dead code
 (sadly, it's more ugly this way)

16 years agounzip: move check for unsupported zip features to better place
Denis Vlasenko [Sat, 26 Jul 2008 17:32:41 +0000 (17:32 -0000)]
unzip: move check for unsupported zip features to better place

16 years agounzip: give better error message when presented with unsupported
Denis Vlasenko [Sat, 26 Jul 2008 16:50:24 +0000 (16:50 -0000)]
unzip: give better error message when presented with unsupported
 zip file. Add zip documentation and an example of file we cant
 (yet) unpack.

16 years agoash: add slightly different testcase
Denis Vlasenko [Sat, 26 Jul 2008 14:20:04 +0000 (14:20 -0000)]
ash: add slightly different testcase

16 years agofix example of vcsa creation
Denis Vlasenko [Sat, 26 Jul 2008 14:02:24 +0000 (14:02 -0000)]
fix example of vcsa creation

16 years agoash: fix testcase to not sleep for whole 10 seconds,
Denis Vlasenko [Sat, 26 Jul 2008 13:53:42 +0000 (13:53 -0000)]
ash: fix testcase to not sleep for whole 10 seconds,
 gets annoying pretty fast. Also fix wrong message there.

16 years agoash: fix typo
Denis Vlasenko [Sat, 26 Jul 2008 13:48:35 +0000 (13:48 -0000)]
ash: fix typo

16 years agoash: hopefully close bug 4324. With testcase.
Denis Vlasenko [Sat, 26 Jul 2008 13:45:57 +0000 (13:45 -0000)]
ash: hopefully close bug 4324. With testcase.

function                                             old     new   delta
evaltree                                             621     869    +248
popstring                                            134     140      +6

16 years agoash: testsuite entries for last change
Denis Vlasenko [Fri, 25 Jul 2008 13:40:06 +0000 (13:40 -0000)]
ash: testsuite entries for last change

16 years agoash: dont allow e.g. exec <&10 to attach to stript's fd!
Denis Vlasenko [Fri, 25 Jul 2008 13:34:05 +0000 (13:34 -0000)]
ash: dont allow e.g. exec <&10 to attach to stript's fd!

function                                             old     new   delta
is_hidden_fd                                           -      61     +61
redirect                                            1135    1164     +29
popstring                                            134     140      +6
printf_main                                          635     637      +2
evalvar                                             1374    1376      +2
echo_main                                            294     296      +2
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 5/0 up/down: 102/0)             Total: 102 bytes

16 years ago*: conversion to config parser
Denis Vlasenko [Thu, 24 Jul 2008 23:38:04 +0000 (23:38 -0000)]
*: conversion to config parser

function                                             old     new   delta
config_read                                          540     597     +57
config_open2                                          41      44      +3
rtnl_rtprot_initialize                                70      66      -4
rtnl_rttable_initialize                               78      73      -5
rtnl_rtscope_initialize                               88      83      -5
rtnl_rtrealm_initialize                               48      43      -5
rtnl_rtdsfield_initialize                             48      43      -5
process_module                                       566     560      -6
bbunpack                                             391     383      -8
rtnl_tab_initialize                                  279     121    -158
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/8 up/down: 60/-196)          Total: -136 bytes

16 years agoash: prevent exec NN>&- from closing fd used for script reading
Denis Vlasenko [Thu, 24 Jul 2008 22:34:43 +0000 (22:34 -0000)]
ash: prevent exec NN>&- from closing fd used for script reading

16 years agoash: fix a bug where redirection fds were not closed afterwards.
Denis Vlasenko [Thu, 24 Jul 2008 19:46:38 +0000 (19:46 -0000)]
ash: fix a bug where redirection fds were not closed afterwards.
 optimize close+fcntl(DUPFD) into dup2. add testsuites.

function                                             old     new   delta
copyfd                                                47      68     +21
argstr                                              1311    1298     -13
popredir                                             148     131     -17
redirect                                            1139    1107     -32
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/3 up/down: 21/-62)            Total: -41 bytes

16 years agoash: teach ash about 123>file. It could take only 0..9 before
Denis Vlasenko [Thu, 24 Jul 2008 19:44:41 +0000 (19:44 -0000)]
ash: teach ash about 123>file. It could take only 0..9 before

function                                             old     new   delta
redirect                                            1052    1139     +87
need_to_remember                                       -      36     +36
popredir                                             132     148     +16
fixredir                                              86     101     +15
readtoken1                                          3130    3143     +13
evalvar                                             1374    1376      +2
popstring                                            140     134      -6
cmdtxt                                               592     561     -31
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 5/2 up/down: 169/-37)           Total: 132 bytes

16 years agoash: ducument where "no fds > 9 in redirects" limitation is.
Denis Vlasenko [Thu, 24 Jul 2008 13:41:37 +0000 (13:41 -0000)]
ash: ducument where "no fds > 9 in redirects" limitation is.
 no code changes.

16 years agoash: ditch dupredirect(), it was only making code harder to read.
Denis Vlasenko [Thu, 24 Jul 2008 11:34:27 +0000 (11:34 -0000)]
ash: ditch dupredirect(), it was only making code harder to read.
 incorporate it in its single callsite.

function                                             old     new   delta
redirect                                            1054    1052      -2
changepath                                           196     194      -2

16 years agoash: explain redirect code a bit
Denis Vlasenko [Thu, 24 Jul 2008 07:54:57 +0000 (07:54 -0000)]
ash: explain redirect code a bit

function                                             old     new   delta
redirect                                            1059    1054      -5

16 years agoash: code shrink
Denis Vlasenko [Thu, 24 Jul 2008 06:07:50 +0000 (06:07 -0000)]
ash: code shrink

function                                             old     new   delta
copynode                                             171     180      +9
evaltreenr                                           615     621      +6
evaltree                                             615     621      +6
calcsize                                             121     127      +6
evalpipe                                             349     350      +1
redirect                                            1059    1057      -2
parseheredoc                                         129     126      -3
makename                                              35      32      -3
expredir                                             130     127      -3
parsefname                                           224     219      -5
popstring                                            140     134      -6
pipeline                                             276     268      -8
list                                                 360     351      -9
readtoken1                                          3157    3130     -27
parse_command                                       1504    1460     -44
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 5/10 up/down: 28/-110)          Total: -82 bytes

16 years agos/othervise/otherwise/g
Denis Vlasenko [Wed, 23 Jul 2008 08:41:08 +0000 (08:41 -0000)]
s/othervise/otherwise/g

16 years agolpd: extend help text
Denis Vlasenko [Wed, 23 Jul 2008 08:39:19 +0000 (08:39 -0000)]
lpd: extend help text

function                                             old     new   delta
packed_usage                                       24466   24612    +146

16 years agoinetd: do not trash errno in signal handlers;
Denis Vlasenko [Tue, 22 Jul 2008 20:57:28 +0000 (20:57 -0000)]
inetd: do not trash errno in signal handlers;
 in CHLD handler, stop looping through services when pid is found

function                                             old     new   delta
reread_config_file                                  1072    1092     +20
retry_network_setup                                   55      69     +14
reap_child                                           132     130      -2

16 years agoanother overlapping_strcpy
Denis Vlasenko [Tue, 22 Jul 2008 20:25:24 +0000 (20:25 -0000)]
another overlapping_strcpy

16 years agofix all cases of strcpy on overlapping strings.
Denis Vlasenko [Tue, 22 Jul 2008 20:16:55 +0000 (20:16 -0000)]
fix all cases of strcpy on overlapping strings.

16 years agofix trivial build warning
Denis Vlasenko [Tue, 22 Jul 2008 19:38:57 +0000 (19:38 -0000)]
fix trivial build warning

16 years agolpd,lpr: send/receive ACKs after filenames, not only after file bodies.
Denis Vlasenko [Tue, 22 Jul 2008 19:15:30 +0000 (19:15 -0000)]
lpd,lpr: send/receive ACKs after filenames, not only after file bodies.

lpqr_main                                           1114    1149     +35
lpd_main                                             748     768     +20

16 years ago- strip implied proto and superfluous "www." domain part.
Bernhard Reutner-Fischer [Tue, 22 Jul 2008 18:32:06 +0000 (18:32 -0000)]
- strip implied proto and superfluous "" domain part.
  If my lynx groks it, your browser will too ;)

16 years ago- wrap overlong lines (Cristian Ionescu-Idbohrn)
Bernhard Reutner-Fischer [Tue, 22 Jul 2008 18:27:53 +0000 (18:27 -0000)]
- wrap overlong lines (Cristian Ionescu-Idbohrn)
- s/\.  /. /g;# (me)

16 years agochown: do not use static data
Denis Vlasenko [Tue, 22 Jul 2008 11:37:23 +0000 (11:37 -0000)]
chown: do not use static data

function                                             old     new   delta
chown_main                                           160     182     +22
fileAction                                           750     744      -6
ugid                                                   8       -      -8

16 years agocut: stop using static data. This alone removed ~70 bytes of code.
Denis Vlasenko [Tue, 22 Jul 2008 10:34:46 +0000 (10:34 -0000)]
cut: stop using static data. This alone removed ~70 bytes of code.
 + some optimizations

function                                             old     new   delta
nlists                                                 4       -      -4
cut_lists                                              4       -      -4
cut_main                                            1041     960     -81

16 years agocal: remove lone static data variable. -4 bytes. coreutils
Denis Vlasenko [Tue, 22 Jul 2008 10:10:13 +0000 (10:10 -0000)]
cal: remove lone static data variable. -4 bytes. coreutils
 is down to four applets with nonzero data+bss.

16 years ago- unused variables if !ENABLE_FEATURE_MDEV_RENAME_REGEXP
Bernhard Reutner-Fischer [Tue, 22 Jul 2008 07:33:53 +0000 (07:33 -0000)]
- unused variables if !ENABLE_FEATURE_MDEV_RENAME_REGEXP

16 years agolibbb: [x]fopen_for_{read,write} introduced and used.
Denis Vlasenko [Mon, 21 Jul 2008 23:05:26 +0000 (23:05 -0000)]
libbb: [x]fopen_for_{read,write} introduced and used.
 (by Valdimir)

function                                             old     new   delta
config_open2                                           -      41     +41
config_read                                          507     542     +35
find_pair                                            169     187     +18
fopen_for_write                                        -      14     +14
fopen_for_read                                         -      14     +14
find_main                                            406     418     +12
xfopen_for_write                                       -      10     +10
xfopen_for_read                                        -      10     +10
popstring                                            134     140      +6
parse_inittab                                        396     401      +5
next_token                                           923     928      +5
pack_gzip                                           1659    1661      +2
bb__parsespent                                       117     119      +2
fallbackSort                                        1719    1717      -2
evalvar                                             1376    1374      -2
qrealloc                                              36      33      -3
...
...
...
...
singlemount                                         4579    4569     -10
process_stdin                                        443     433     -10
patch_main                                          1111    1101     -10
ifupdown_main                                       2175    2165     -10
file_action_grep                                      90      80     -10
uuidcache_init                                       649     637     -12
hush_main                                            797     785     -12
read_config                                          230     217     -13
dpkg_main                                           3835    3820     -15
read_line_input                                     3134    3110     -24
sysctl_main                                          232     203     -29
config_open                                           40      10     -30
WARN_BAD_LINE                                         44       -     -44
login_main                                          1714    1575    -139
------------------------------------------------------------------------------
(add/remove: 5/1 grow/shrink: 8/74 up/down: 174/-737)        Total: -563 bytes

16 years agowhitespace fixes, no code changed
Denis Vlasenko [Mon, 21 Jul 2008 21:34:51 +0000 (21:34 -0000)]
whitespace fixes, no code changed

16 years ago- commentary typo fix
Bernhard Reutner-Fischer [Mon, 21 Jul 2008 15:29:36 +0000 (15:29 -0000)]
- commentary typo fix

16 years ago- first pass to unify/cleanup uid handling (-236b)
Bernhard Reutner-Fischer [Mon, 21 Jul 2008 14:41:33 +0000 (14:41 -0000)]
- first pass to unify/cleanup uid handling (-236b)
  This needs further love, alot of love.. Tito?

16 years ago- fix spelling
Bernhard Reutner-Fischer [Mon, 21 Jul 2008 13:46:54 +0000 (13:46 -0000)]
- fix spelling

16 years ago- s/super.block/superblock/g; # for consistency; -1b
Bernhard Reutner-Fischer [Mon, 21 Jul 2008 13:33:22 +0000 (13:33 -0000)]
- s/super.block/superblock/g; # for consistency; -1b

16 years ago- remove superfluous forward declaration
Bernhard Reutner-Fischer [Mon, 21 Jul 2008 11:53:04 +0000 (11:53 -0000)]
- remove superfluous forward declaration

16 years ago- document -f
Bernhard Reutner-Fischer [Mon, 21 Jul 2008 11:30:51 +0000 (11:30 -0000)]
- document -f

16 years ago- commentary typo fix
Bernhard Reutner-Fischer [Mon, 21 Jul 2008 11:18:02 +0000 (11:18 -0000)]
- commentary typo fix

16 years ago- no obj-code changes. Fix indentation, use existing defines.
Bernhard Reutner-Fischer [Mon, 21 Jul 2008 11:16:39 +0000 (11:16 -0000)]
- no obj-code changes. Fix indentation, use existing defines.

16 years agotelnet: shrink
Denis Vlasenko [Mon, 21 Jul 2008 09:22:28 +0000 (09:22 -0000)]
telnet: shrink
telnetd: shrink, and fix issue file printing
test: better and shorter usage text

function                                             old     new   delta
putiac2                                               51      50      -1
putiac                                                24      20      -4
handlenetoutput                                       95      91      -4
telnet_main                                         1480    1475      -5
iacflush                                              37      32      -5
make_new_session                                     436     421     -15
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/6 up/down: 0/-34)             Total: -34 bytes

16 years agohelp text: test --help doesnt print it (by design),
Denis Vlasenko [Mon, 21 Jul 2008 08:37:13 +0000 (08:37 -0000)]
help text: test --help doesnt print it (by design),
 so do not account for it

16 years agohttpd: add Hopedir directive specially for
Denis Vlasenko [Sun, 20 Jul 2008 23:25:32 +0000 (23:25 -0000)]
httpd: add Hopedir directive specially for
 (and by) walter harms <wharms AT bfs.de>;
 fix silly double-parse bug added in 21412.

function                                             old     new   delta
parse_conf                                          1532    1576     +44

16 years agomsh: fix "while...continue" bug 3884.
Denis Vlasenko [Sun, 20 Jul 2008 23:03:23 +0000 (23:03 -0000)]
msh: fix "while...continue" bug 3884.