Commit Graph

1161 Commits

Author SHA1 Message Date
Denis Vlasenko
006e8628fc unzip: handle "central directory"
needed for OpenOffice, gmail attachment .zips etc
 conditional on CONFIG_DESKTOP

function                                             old     new   delta
unzip_main                                          1643    1939    +296
find_cds_offset                                        -     173    +173
unzip_skip                                            11      16      +5
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 2/0 up/down: 474/0)             Total: 474 bytes
2008-09-21 01:01:46 +00:00
Denis Vlasenko
540baf646a 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
2008-08-05 13:16:18 +00:00
Denis Vlasenko
e9ad84dfd4 *: 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
2008-08-05 13:10:34 +00:00
Denis Vlasenko
27842288b3 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
2008-08-04 13:20:36 +00:00
Denis Vlasenko
48a9971bd4 unzip: move check for unsupported zip features to better place 2008-07-26 17:32:41 +00:00
Denis Vlasenko
c2dcb7cf63 unzip: give better error message when presented with unsupported
zip file. Add zip documentation and an example of file we cant
 (yet) unpack.
2008-07-26 16:50:24 +00:00
Denis Vlasenko
68a192c007 fix trivial build warning 2008-07-22 19:38:57 +00:00
Bernhard Reutner-Fischer
3e8669f359 - wrap overlong lines (Cristian Ionescu-Idbohrn)
- s/\.  /. /g;# (me)
2008-07-22 18:27:53 +00:00
Denis Vlasenko
5415c856ea libbb: [x]fopen_for_{read,write} introduced and used.
(by Valdimir)

function                                             old     new   delta
config_open2                                           -      41     +41
config_read                                          507     542     +35
find_pair                                            169     187     +18
fopen_for_write                                        -      14     +14
fopen_for_read                                         -      14     +14
find_main                                            406     418     +12
xfopen_for_write                                       -      10     +10
xfopen_for_read                                        -      10     +10
popstring                                            134     140      +6
parse_inittab                                        396     401      +5
next_token                                           923     928      +5
pack_gzip                                           1659    1661      +2
bb__parsespent                                       117     119      +2
fallbackSort                                        1719    1717      -2
evalvar                                             1376    1374      -2
qrealloc                                              36      33      -3
...
...
...
...
singlemount                                         4579    4569     -10
process_stdin                                        443     433     -10
patch_main                                          1111    1101     -10
ifupdown_main                                       2175    2165     -10
file_action_grep                                      90      80     -10
uuidcache_init                                       649     637     -12
hush_main                                            797     785     -12
read_config                                          230     217     -13
dpkg_main                                           3835    3820     -15
read_line_input                                     3134    3110     -24
sysctl_main                                          232     203     -29
config_open                                           40      10     -30
WARN_BAD_LINE                                         44       -     -44
login_main                                          1714    1575    -139
------------------------------------------------------------------------------
(add/remove: 5/1 grow/shrink: 8/74 up/down: 174/-737)        Total: -563 bytes
2008-07-21 23:05:26 +00:00
Denis Vlasenko
adc772a5f2 tar: fix handling of tarballs with symlinks with size field != 0 2008-07-20 17:10:43 +00:00
Denis Vlasenko
bc06fb27d2 build system: fix indentation in config menu 2008-07-17 18:26:45 +00:00
Denis Vlasenko
4d0cd28947 cpio: make long opts depend only on ENABLE_GETOPT_LONG 2008-07-16 21:51:43 +00:00
Denis Vlasenko
52ec4b98d5 whitespace fixes 2008-07-12 23:02:43 +00:00
Denis Vlasenko
a46dd89e94 cpio: internalize archive_xread_all_eof. add a few paranoia checks
for corrupted cpio files.
modprobe-small: remove stray include
route: small code shrink

function                                             old     new   delta
get_header_cpio                                      958     980     +22
archive_xread_all_eof                                 33       -     -33
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/0 up/down: 22/-33)            Total: -11 bytes
2008-07-12 09:20:44 +00:00
Denis Vlasenko
ee1b3b1042 cpio: on unpack, limit filename length to 8k; shorten comment a bit 2008-07-11 22:20:59 +00:00
Denis Vlasenko
2b407b12be cpio: support some long options; document GNU options 2008-07-11 21:42:12 +00:00
Denis Vlasenko
86090e2599 fix compile failures resulting from last few commits 2008-07-11 08:23:52 +00:00
Denis Vlasenko
0381d422d9 dpkg_deb: slight code shrink
ar: reuse existing ar unpacking code
get_header_tar: handle autodetection for tiny .tar.gz files too
unarchive.h: do not include CONFIGed out things

function                                             old     new   delta
get_header_tar                                      1521    1534     +13
dpkg_deb_main                                        400     380     -20
ar_main                                              260     196     -64
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/2 up/down: 13/-84)            Total: -71 bytes
2008-07-10 23:06:00 +00:00
Denis Vlasenko
b6052724ff open_transformer: do not return fd, it does not change
libbb: adopt zipped read from modprobe-small

function                                             old     new   delta
getoptscmd                                           708     713      +5
qgravechar                                           106     109      +3
huft_build                                          1165    1168      +3
tr_main                                              474     472      -2
open_transformer                                      91      89      -2
evalvar                                             1376    1374      -2
rpm_main                                            1691    1688      -3
qrealloc                                              36      33      -3
get_header_tar_lzma                                   55      52      -3
get_header_tar_gz                                    100      97      -3
get_header_tar_bz2                                    55      52      -3
get_header_tar_Z                                      89      86      -3
find_main                                            418     406     -12
prepare                                              302     283     -19
xmalloc_open_zipped_read_close                       161     135     -26
xmalloc_read                                         248     199     -49
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/13 up/down: 11/-130)         Total: -119 bytes
2008-07-10 17:43:01 +00:00
Denis Vlasenko
deeed59de0 libbb: introduce and use xrealloc_vector
function                                             old     new   delta
xrealloc_vector_helper                                 -      51     +51
create_list                                           84      99     +15
getopt_main                                          690     695      +5
passwd_main                                         1049    1053      +4
get_cached                                            85      89      +4
msh_main                                            1377    1380      +3
add_match                                             42      41      -1
read_lines                                           720     718      -2
grave                                               1068    1066      -2
fill_match_lines                                     143     141      -2
add_to_dirlist                                        67      65      -2
add_input_file                                        49      47      -2
act                                                  252     250      -2
fsck_main                                           2252    2246      -6
man_main                                             765     757      -8
bb_internal_initgroups                               228     220      -8
cut_main                                            1052    1041     -11
add_edge_to_node                                      55      43     -12
dpkg_main                                           3851    3835     -16
ifupdown_main                                       2202    2178     -24
sort_main                                            838     812     -26
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 5/15 up/down: 82/-124)          Total: -42 bytes
2008-07-08 05:14:36 +00:00
Denis Vlasenko
a60f84ebf0 *: rename ATTRIBUTE_XXX to just XXX. 2008-07-05 09:18:54 +00:00
Denis Vlasenko
fa0b56db76 sendmail: fix wrong vfork usage here too
*: shorten error texts

function                                             old     new   delta
launch_helper                                          -     151    +151
vfork_or_die                                          20       -     -20
sendgetmail_main                                    1946    1848     -98
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 0/1 up/down: 151/-118)           Total: 33 bytes
2008-07-01 16:09:07 +00:00
Denis Vlasenko
82604e9730 revert last two commits. vfork cannot be used in subroutine,
it trashes stack on return
2008-07-01 15:59:42 +00:00
Denis Vlasenko
58d60c3333 *: introduce and use xfork()
function                                             old     new   delta
xfork                                                  -      20     +20
msh_main                                            1377    1380      +3
mod_process                                          455     446      -9
forkexit_or_rexec                                     30      17     -13
expand_variables                                    1434    1421     -13
open_transformer                                      91      76     -15
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/4 up/down: 23/-50)            Total: -27 bytes
2008-07-01 11:11:24 +00:00
Denis Vlasenko
3da5572bfa *: introduce and use xvfork()
function                                             old     new   delta
time_main                                           1052    1285    +233
crontab_main                                         623     856    +233
ifupdown_main                                       2202    2403    +201
xvfork                                                 -      20     +20
passwd_main                                         1049    1053      +4
grave                                               1068    1066      -2
script_main                                          935     921     -14
vfork_or_die                                          20       -     -20
vfork_compressor                                     206     175     -31
open_as_user                                         109       -    -109
popen2                                               218       -    -218
edit_file                                            910     690    -220
run_command                                          268       -    -268
------------------------------------------------------------------------------
(add/remove: 1/4 grow/shrink: 4/4 up/down: 691/-882)         Total: -191 bytes
2008-07-01 10:40:41 +00:00
Denis Vlasenko
86d88c0990 bunzip2: make proper fix for the problem "fixed" in rev. 22521
Thanks for Rob Landley <rob@landley.net>
2008-06-28 18:10:09 +00:00
Denis Vlasenko
a60936da06 libunarchive: stop using static data in archivers - archive_handle_t
can trivially provide space for that.
rpm: code shrink
tar: simplify autodetection of bz2/.gz


function                                             old     new   delta
static.not_first                                       1       -      -1
static.end                                             1       -      -1
bb_makedev                                            51      49      -2
static.saved_hardlinks_created                         4       -      -4
static.saved_hardlinks                                 4       -      -4
longname                                               4       -      -4
linkname                                               4       -      -4
hash_file                                            251     247      -4
get_header_tar                                      1528    1521      -7
rpm_main                                            1711    1697     -14
get_header_cpio                                      965     944     -21
------------------------------------------------------------------------------
(add/remove: 0/6 grow/shrink: 0/5 up/down: 0/-66)             Total: -66 bytes
   text    data     bss     dec     hex filename
 804926     611    6868  812405   c6575 busybox_old
 804878     611    6852  812341   c6535 busybox_unstripped
2008-06-28 05:04:09 +00:00
Denis Vlasenko
55da0be405 support gzip -t and bzip2 -t 2008-06-27 21:52:41 +00:00
Denis Vlasenko
bbd55c9ec7 cpio: fix -m to actually work as expected (Pascal Bellard)
function                                             old     new   delta
cpio_main                                           1140    1153     +13
2008-06-27 15:52:07 +00:00
Denis Vlasenko
2bbdda09df unlzma: fix memory leak (Pascal Bellard) 2008-06-27 15:48:45 +00:00
Denis Vlasenko
defc1ea340 *: introduce and use FAST_FUNC: regparm on i386, otherwise no-on
text    data     bss     dec     hex filename
 808035     611    6868  815514   c719a busybox_old
 804472     611    6868  811951   c63af busybox_unstripped
2008-06-27 02:52:20 +00:00
Denis Vlasenko
5fb79535ee bunzip2: fix an uncompression error. Add the example to testsuite. 2008-06-26 20:27:42 +00:00
Denis Vlasenko
f5d8c90d73 style fixes, no code changes 2008-06-26 14:32:57 +00:00
Denis Vlasenko
2649f215ae open_transformer: fix bug of calling exit instead of _exit
open_transformer: don't leak compressed descriptor anymore
recursive_action: tiny shrink
2008-06-26 03:26:57 +00:00
Denis Vlasenko
a04cc47f1c b[un]zip2, g[un]zip: unlink destination if -f is given. Closes 3854 2008-06-25 20:54:45 +00:00
Denis Vlasenko
c87339d584 dpkg: trivial code shrinkage, and redo G trick correctly.
function                                             old     new   delta
run_package_script_or_die                              -      72     +72
fill_package_struct                                  303     309      +6
search_package_hashtable                             122     125      +3
get_status                                           112     111      -1
status_hashtable                                       4       -      -4
set_status                                           162     158      -4
package_hashtable                                      4       -      -4
name_hashtable                                         4       -      -4
package_satisfies_dependency                         112     106      -6
search_name_hashtable                                118     110      -8
configure_package                                    121     106     -15
remove_package                                       333     317     -16
search_status_hashtable                              133     111     -22
purge_package                                        247     217     -30
unpack_package                                       552     521     -31
run_package_script                                    62       -     -62
dpkg_main                                           3991    3867    -124
------------------------------------------------------------------------------
(add/remove: 1/4 grow/shrink: 2/10 up/down: 81/-331)         Total: -250 bytes
   text    data     bss     dec     hex filename
 807972     611    6924  815507   c7193 busybox_old
 807603     611    6908  815122   c7012 busybox_unstripped
2008-06-21 23:15:43 +00:00
Denis Vlasenko
d235f58ac2 dpkg: code shrink
dpkg: add documentation from bug 3644

function                                             old     new   delta
remove_package                                       318     333     +15
unpack_package                                       541     552     +11
purge_package                                        242     247      +5
all_control_list                                      55      53      -2
all_control_files                                     44      40      -4
add_split_dependencies                               709     703      -6
search_status_hashtable                              148     133     -15
search_package_hashtable                             137     122     -15
search_name_hashtable                                134     118     -16
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/6 up/down: 31/-58)            Total: -27 bytes
   text    data     bss     dec     hex filename
 808093     611    6924  815628   c720c busybox_old
 807972     611    6924  815507   c7193 busybox_unstripped
2008-06-21 22:46:58 +00:00
Denis Vlasenko
20273138fc dpkg: code shrink (by Peter Korsgaard <jacmet@uclibc.org>)
function                                             old     new   delta
create_list                                          104      86     -18
2008-06-21 22:10:52 +00:00
Denis Vlasenko
d50dda8c35 *: use llist_pop for traverse-and-free list operation
function                                             old     new   delta
append_file_list_to_list                             109     111      +2
udhcpc_main                                         2414    2413      -1
run_parts_main                                       325     324      -1
od_main                                             2324    2323      -1
getopt_main                                          709     707      -2
env_main                                             253     251      -2
sed_main                                             659     656      -3
ps_main                                              522     519      -3
traceroute_main                                     3960    3954      -6
sort_main                                            844     838      -6
diff_main                                            866     858      -8
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/10 up/down: 2/-33)            Total: -31 bytes
2008-06-15 05:40:56 +00:00
Denis Vlasenko
7a762f9dbf tar: fix "unused parameter 'gzip'" warning 2008-06-14 19:38:35 +00:00
Bernhard Reutner-Fischer
f0d6068086 - The conffiles control file isn't required in Debian packages, so don't
error out if it's missing. (Peter Korsgaard)
2008-06-05 12:18:42 +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
6b06cb80be more of -Wall fixes from Cristian Ionescu-Idbohrn.
Some are fixing real bugs.

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

function                                             old     new   delta
nexpr                                                820     828      +8
tail_main                                           1200    1202      +2
wrapf                                                166     167      +1
parse_mount_options                                  227     209     -18
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/1 up/down: 11/-18)             Total: -7 bytes
2008-05-13 02:27:31 +00:00
Denis Vlasenko
05efca90d2 tar: fix obscure case when name is "" and prefix is not "" 2008-04-29 04:12:58 +00:00
Denis Vlasenko
d93400bffb tar: fix the case where long base names can be ignored 2008-04-29 03:54:16 +00:00
Denis Vlasenko
c450379ff0 tar: remove bogus check for "-" (we handle it corrently later)
tar: simplify argv handling

function                                             old     new   delta
tar_main                                             772     722     -50
2008-04-29 02:43:23 +00:00
Denis Vlasenko
ffdcb41fd2 build system: typo fix in help text 2008-04-23 05:46:55 +00:00
Denis Vlasenko
5a07a1d255 tar: move vfork into separate function (smaller code)
open_transformer: more informative error messages

function                                             old     new   delta
vfork_compressor                                       -     210    +210
writeTarFile                                         547     299    -248
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/1 up/down: 210/-248)          Total: -38 bytes
2008-04-21 21:56:07 +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
1af00eda92 cpio: fix a bug where we do not extract zero-sized hardlinks
(spotted at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=466771).
Add testsuite entry for that, and another one for another bug:
we do not list hardlinks in cpio -t (not fixed).

function                                             old     new   delta
get_header_cpio                                      884     909     +25
static.saved_hardlinks_created                         -       4      +4
static.pending_hardlinks                               4       -      -4
static.inode                                           4       -      -4
cpio_main                                           1122    1060     -62
2008-04-05 02:44:30 +00:00
Denis Vlasenko
1a95e3960c cpio: typo fix in error message 2008-04-05 00:13:19 +00:00
Denis Vlasenko
261f237024 cpio: optional support for writing cpio files in newc format.
by pascal.bellard AT ads-lu.com.

function                                             old     new   delta
cpio_main                                            247    1122    +875
cpio_pad4                                              -      58     +58
gnu_dev_major                                         66      99     +33
gnu_dev_minor                                         38      57     +19
packed_usage                                       23964   23978     +14
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 4/0 up/down: 999/0)             Total: 999 bytes
2008-04-05 00:07:46 +00:00
Denis Vlasenko
5297809c03 g[un]zip: accept and ignore -n (needed for kernel compile) 2008-03-30 13:11:47 +00:00
Denis Vlasenko
2570b2e575 whitespace fixes 2008-03-28 01:00:09 +00:00
Denis Vlasenko
8ee649a02e *: more uniform naming: s/xmalloc_getline/xmalloc_fgetline/ 2008-03-26 20:04:27 +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
c0183e6e0d unlzma: shrink by Pascal Bellard <pascal.bellard AT ads-lu.com> 2008-03-18 03:13:25 +00:00
Denis Vlasenko
4ee7cd4f6f *: mode tcp/udpsvd to networking, delete ipsvd/*
*/Config.in: fixes to text
svlogd: make it NOMMU capable

function                                             old     new   delta
processorstart                                       378     420     +42
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/0 up/down: 42/0)               Total: 42 bytes
   text    data     bss     dec     hex filename
 797153     662    7420  805235   c4973 busybox_old
 797196     662    7420  805278   c499e busybox_unstripped
2008-03-17 09:13:22 +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
9f153f610f fsck_minix: getopt32-ification; code shrink; reduce stack usage;
fix bug in map_block2: s/(blknr >= 256 * 256)/(blknr < 256 * 256)/

function                                             old     new   delta
get_inode_common                                       -     291    +291
add_zone_common                                        -     205    +205
ask                                                  229     215     -14
write_super_block                                    109      90     -19
write_block                                          653     629     -24
bad_zone                                              95      64     -31
read_block                                           241     198     -43
fsck_minix_main                                     3285    3195     -90
add_zone2                                            217      34    -183
add_zone                                             216      33    -183
recursive_check                                     1097     866    -231
recursive_check2                                    1340     956    -384
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 0/10 up/down: 496/-1202)       Total: -706 bytes
   text    data     bss     dec     hex filename
 799349     661    7428  807438   c520e busybox_old
 798437     661    7428  806526   c4e7e busybox_unstripped
2008-03-17 08:32:26 +00:00
Denis Vlasenko
444639cc21 unlzma: save a few more bytes, and maybe even a bit faster now 2008-03-02 18:56:23 +00:00
Denis Vlasenko
c3fff877e1 unlzma: if !LZMA_FAST, save ~200 more bytes (Pascal Bellard <pascal.bellard AT ads-lu.com>) 2008-03-02 18:55:49 +00:00
Denis Vlasenko
574f2f4394 *: add optimization barrier to all "G trick" locations 2008-02-27 18:41:59 +00:00
Denis Vlasenko
e7b43cf59f trivial fixes to config system 2008-02-19 23:42:22 +00:00
Denis Vlasenko
431a7c9c53 tar: optional autodetection of gz/bz2 compressed tarballs.
+130 bytes. Closes bug 992.
2008-02-19 11:26:28 +00:00
Denis Vlasenko
b3b0753593 dpkg: fix bug where existence check was reversed 2008-02-17 14:29:25 +00:00
Denis Vlasenko
3718832a15 *: more readable handling of pipe fds. No code changes. 2008-02-16 13:20: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
e00e5025ec tar: real support for -p. +200 if selected.
By Natanael Copa <natanael.copa at gmail.com>
2008-02-14 20:37:54 +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
23ffb6a4a2 tar: compat: handle tarballs with only one zero block at the end 2008-02-13 17:52:42 +00:00
Denis Vlasenko
87cf2ee8ab tar: move FNM_LEADING_DIR #define to tar.c - no other users.
Closes bug 1332.
2008-02-13 17:06:53 +00:00
Denis Vlasenko
e8ef7ec7de unzip: do not try to read entire compressed stream at once (it can be huge)
unzip: handle short reads correctly
2008-02-04 12:12:48 +00:00
Denis Vlasenko
847fa779af *: tidy up usage of char **environ 2008-01-28 22:45:43 +00:00
Denis Vlasenko
fb0eba706c libbb: introduce and use safe_waitpid (loops in EINTR)
*: use more approproate (shorter) versions of wait()

function                                             old     new   delta
safe_waitpid                                           -      48     +48
wait_any_nohang                                        -      17     +17
send_tree                                            365     369      +4
processorstop                                        432     435      +3
text_yank                                            110     108      -2
make_human_readable_str                              202     200      -2
crond_main                                          1368    1366      -2
handle_sigchld                                        49      43      -6
reapchild                                            166     159      -7
custom                                               260     250     -10
checkscript                                          191     177     -14
wait_nohang                                           17       -     -17
wait_pid                                              43       -     -43
------------------------------------------------------------------------------
(add/remove: 2/2 grow/shrink: 2/7 up/down: 72/-103)           Total: -31 bytes
2008-01-02 19:55:04 +00:00
Denis Vlasenko
abee3d0e0d Fix xmalloc_fgets_str so that it really does NOT strip terminator.
Add xmalloc_fgetline_str which does strip terminator,
and use it in dpkg instead of xmalloc_fgets_str.
netstat: use xmalloc_fgets_str - allows to eat strings with NULs
(this fixes bug with some weird /proc/net/unix input)

function                                             old     new   delta
xmalloc_fgets_internal                                 -     191    +191
xmalloc_fgetline_str                                   -      18     +18
do_info                                              116     120      +4
unix_do_one                                          451     447      -4
tcp_do_one                                           423     419      -4
send_tree                                            369     365      -4
xmalloc_fgets_str                                    178      15    -163
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 1/4 up/down: 213/-175)           Total: 38 bytes
   text    data     bss     dec     hex filename
 778445     832    7344  786621   c00bd busybox_old
 778483     832    7344  786659   c00e3 busybox_unstripped
2007-12-26 20:44:45 +00:00
Denis Vlasenko
f7be20e70c nameif: extended matching (Nico Erfurth <masta@perlgolf.de>)
*: whitespace fixes

function                                             old     new   delta
prepend_new_eth_table                                  -     304    +304
nameif_main                                          620     684     +64
cc_macaddr                                            51       -     -51
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 1/0 up/down: 368/-51)           Total: 317 bytes
2007-12-24 14:09:19 +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
Paul Fox
16aec39ebe add comment clarifying busybox's use of non-standard tar header 2007-11-17 19:11:05 +00:00
Denis Vlasenko
8512862163 tar: fix a case where glibc detects bogus buffer overrun
which is not really there!
2007-11-16 20:35:30 +00:00
Denis Vlasenko
059c91711f open_transformer: do not duplicate "<program> -cf -"
text    data     bss     dec     hex filename
 677858     738    7236  685832   a7708 busybox_old
 677804     738    7236  685778   a76d2 busybox_unstripped
2007-11-12 02:13:12 +00:00
Denis Vlasenko
4bfb84db4e gzip: fix a case where tar xzf fails (we use uninitialized fd) 2007-11-12 01:44:49 +00:00
Denis Vlasenko
e7fca5125a *: remove superfluous "?" in option parsing 2007-11-10 01:32:18 +00:00
Denis Vlasenko
cd0fbb5e77 unzip: hmm... gcc doesn't like ATTRIBUTE_PACKED?? Document that... 2007-11-06 02:16:01 +00:00
Denis Vlasenko
018b155ad9 telnetd: fix problem with zombies (by Paul Fox <pgf@brightstareng.com>)
syslogd: strip trailing NULs
2007-11-06 01:38:46 +00:00
Paul Fox
cb981638f5 change safety check on zip header to allow for extra length, and
revert the header read to use the correct constant rather than
sizeof.  at least one version of gcc (armv4-linux-gcc-3.4.1) pads
the struct to 28 bytes in spite of the packing.
2007-11-05 23:09:03 +00:00
Denis Vlasenko
6cee58e9cf Announce 1.8.0 2007-11-04 15:43:26 +00:00
Denis Vlasenko
6fa3ab3cf1 bzip2: make -d actually work 2007-10-21 18:59:58 +00:00
Denis Vlasenko
fcc569637b unzip: add a comment explaining why we don't die 2007-10-19 21:03:09 +00:00
Denis Vlasenko
bc7c5d082e unzip: fix endianness bugs 2007-10-18 23:27:46 +00:00
Denis Vlasenko
0de37e10ed ash: use fdprintf, not dprintf.
*: trailing whitespace removed
2007-10-17 11:08:53 +00:00
Denis Vlasenko
31acd1ba0a bzip2: more of code shrink
compressStream                                       503     473     -30
BZ2_bzCompress                                        78       -     -78
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 0/1 up/down: 0/-108)           Total: -108 bytes
   text    data     bss     dec     hex filename
 676300    2538   12104  690942   a8afe busybox_old
 676192    2538   12104  690834   a8a92 busybox_unstripped
2007-10-17 10:14:11 +00:00
Denis Vlasenko
686b0ef7d8 bzip2: move state pointer to the offset 0 (smaller code)
ifdef out DecompressEnd if FEATURE_CLEAN_UP is not seleted

fallbackSort                                        1655    1672     +17
mainSort                                            2447    2458     +11
bzip2_main                                           109     119     +10
.rodata                                           123466  123469      +3
generateMTFValues                                    433     435      +2
handle_compress                                      355     356      +1
BZ2_bzCompress                                        79      78      -1
prepare_new_block                                     55      48      -7
compressStream                                       547     503     -44
sendMTFValues                                       2225    2140     -85
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 6/4 up/down: 44/-137)           Total: -93 bytes
   text    data     bss     dec     hex filename
 676421    2538   12104  691063   a8b77 busybox_old
 676328    2538   12104  690970   a8b1a busybox_unstripped
2007-10-16 14:07:41 +00:00
Denis Vlasenko
008eda2c54 bzip2: make -s equivalent to -2 (compatible with standard bzip2)
telnetd: typo fix in comment
2007-10-16 10:47:27 +00:00
Denis Vlasenko
b6ccd32e3f bzip2: implement -1..-9 command line flags 2007-10-14 07:51:19 +00:00
Denis Vlasenko
6a9154b6f6 bzip2: eliminate some divisions 2007-10-14 07:49:48 +00:00
Denis Vlasenko
3f5fdc7572 remove trailing whitespace 2007-10-14 04:55:59 +00:00
Denis Vlasenko
9435993b01 bzip2: code size shrink 2007-10-14 01:37:53 +00:00
Denis Vlasenko
be5a7b9655 bzip2: remove files which are not used anymore 2007-10-14 00:44:10 +00:00
Denis Vlasenko
ef3aabe906 bzip2: size reduction, to just below 9k. 2007-10-14 00:43:01 +00:00
Denis Vlasenko
77f1ec1b9b bzip2: port bzip2 1.0.4 to busybox. note: bzip2 code resides
in separate directory (archival/bz/*)
and is covered by BSD-style license.
code size: 13k
2007-10-13 03:36:03 +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
52a4388d95 bunzip: small code shrink and consmetics
read_bunzip                                          276     283      +7
get_bits                                             184     162     -22
get_next_block                                      1833    1810     -23
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/2 up/down: 7/-45)             Total: -38 bytes
2007-10-10 20:53:41 +00:00
Denis Vlasenko
91e80c2be7 delete now unused check_header_gzip.c
sum: do not use uintmax needlessly
2007-10-05 20:29:31 +00:00
Denis Vlasenko
d21f596ddb add tests for gunzip 2007-10-05 15:27:03 +00:00
Denis Vlasenko
5dd8a03665 gunzip: support concatenated gz files.
text    data     bss     dec     hex filename
 770988    1029    9552  781569   bed01 busybox.t0/busybox
 771105    1029    9552  781686   bed76 busybox.t3/busybox
2007-10-05 15:26:08 +00:00
Denis Vlasenko
feb7ae7f01 printf("%s\n") -> puts() 2007-10-01 12:05:12 +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
66bbfbd581 bunzip2: trim verbose messages
text    data     bss     dec     hex filename
 770752    1029    9696  781477   beca5 busybox_old
 770691    1029    9696  781416   bec68 busybox_unstripped
2007-09-28 23:45:56 +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
e9b3321b9f tar: add a comment about previous subtle fix 2007-09-24 19:32:53 +00:00
Denis Vlasenko
86e0a22ec6 tar: strip leading '/' BEFORE memorizing hardlink's name
function                                             old     new   delta
writeFileToTarball                                  1362    1352     -10
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-10)             Total: -10 bytes
2007-09-24 19:07:57 +00:00
Denis Vlasenko
0beaff8c19 update Glenn McGrath's email address 2007-09-21 13:16:32 +00:00
Denis Vlasenko
476b070036 style fix, no code changes 2007-09-09 14:11:11 +00:00
Denis Vlasenko
bf8fcaceb7 open_transformer: fix vda's goofup 2007-09-09 11:20:55 +00:00
Paul Fox
9382b3809b overload the existing '-q' flag so that if '-l' and '-q' are used
together, a "short form" listing (just pathnames) is generated.
change a few flag variables to "smallint" as well.
2007-09-07 20:28:25 +00:00
Denis Vlasenko
211f7f88ae tar + gzip/bzip2/etc: support NOMMU machines (by Alex Landau <landau_alex@yahoo.com>) 2007-09-05 11:48:32 +00:00
Denis Vlasenko
7e0fbf9c26 tar: conditionally don't wait for vforked child to exec, as it always
works right on Linux, and anyway mayresult only on less-than-clear error
message only, it will not cause tar to misbehave.

function                                             old     new   delta
open_transformer                                      98      80     -18
writeTarFile                                         714     547    -167
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-185)           Total: -185 bytes
   text    data     bss     dec     hex filename
 770651    1051   10764  782466   bf082 busybox_old
 770463    1051   10764  782278   befc6 busybox_unstripped
2007-09-04 19:33:22 +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
856be770a6 assorted fixes for breakage found by randomconfig 2007-08-17 08:29:48 +00:00
Denis Vlasenko
dbe6e66d6a trylink: automatically use custom link script if user provides one
vinfo_msg: one user (info_msg), incorporate in it
*: style fixes
2007-08-14 16:43:01 +00:00
Denis Vlasenko
e324184c05 s/#ifdef CONFIG_/#if ENABLE_/g 2007-08-13 10:36:25 +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
990d0f63ee Replace index_in_[sub]str_array with index_in_[sub]strings,
which scans thru "abc\0def\0123\0\0" type strings. Saves 250 bytes.

   text    data     bss     dec     hex filename
 781266    1328   11844  794438   c1f46 busybox_old
 781010    1328   11844  794182   c1e46 busybox_unstripped
2007-07-24 15:54:42 +00:00
Denis Vlasenko
bdc88fdc68 rework long option handling. saves ~1.2k
function                                             old     new   delta
tar_longopts                                           -     222    +222
static.udhcpc_longopts                                 -     192    +192
start_stop_daemon_longopts                             -     150    +150
getopt32                                            1045    1185    +140
static.wget_longopts                                   -     111    +111
static.od_longopts                                     -     105    +105
getopt_longopts                                        -      96     +96
install_longopts                                       -      67     +67
ipcalc_longopts                                        -      63     +63
static.hwclock_longopts                                -      54     +54
ftpgetput_longopts                                     -      52     +52
static.dumpleases_longopts                             -      32     +32
env_longopts                                           -      31     +31
runparts_longopts                                      -      30     +30
mv_longopts                                            -      24     +24
mkdir_longopts                                         -      19     +19
find_pair                                            164     180     +16
bb_null_long_options                                   -      16     +16
setconsole_longopts                                    -      10     +10
display_speed                                         91      98      +7
collect_blk                                          467     474      +7
show_color                                             4       1      -3
ls_main                                              913     904      -9
bb_default_long_options                               16       -     -16
ls_color_opt                                          32      10     -22
setconsole_long_options                               32       -     -32
arith                                               2077    2030     -47
mv_long_options                                       48       -     -48
mkdir_long_options                                    48       -     -48
env_long_options                                      48       -     -48
static.options                                       248     184     -64
runparts_long_options                                 80       -     -80
ftpgetput_long_options                                96       -     -96
static.hwclock_long_options                          112       -    -112
install_long_options                                 112       -    -112
static.long_options                                  144       -    -144
static.wget_long_options                             160       -    -160
longopts                                             160       -    -160
static.arg_options                                   304       -    -304
tar_long_options                                     320       -    -320
long_options                                         384       -    -384
------------------------------------------------------------------------------
(add/remove: 17/15 grow/shrink: 4/5 up/down: 1444/-2209)     Total: -765 bytes
   text    data     bss     dec     hex filename
 782618    1328   11900  795846   c24c6 busybox_old
 781354    1328   11900  794582   c1fd6 busybox_unstripped
2007-07-23 17:14:14 +00:00
Denis Vlasenko
b71c668c57 style fix (stray space before ';') 2007-07-21 15:08:09 +00:00
Denis Vlasenko
091965768d libbb: nuke BB_GETOPT_ERROR, always die if there are mutually exclusive options
find_pair                                            164     180     +16
passwd_main                                         1222    1230      +8
display_speed                                         91      96      +5
msh_main                                            1335    1339      +4
qrealloc                                              38      36      -2
refresh                                             1190    1182      -8
cut_main                                             543     532     -11
sendCgi                                             1807    1794     -13
getopt32                                            1063    1045     -18
arith                                               2077    2030     -47
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/6 up/down: 33/-99)            Total: -66 bytes
   text    data     bss     dec     hex filename
 781548    1168   11900  794616   c1ff8 busybox_old
 781452    1168   11900  794520   c1f98 busybox_unstripped
2007-07-21 13:27:44 +00:00
Denis Vlasenko
931de892cc random shrinkage of statics, -60 bytes saved 2007-06-21 12:43:45 +00:00
Denis Vlasenko
a80b4a0fa7 tar: improve OLDGNU compat, make old SUN compat configurable 2007-06-21 12:41:59 +00:00
Denis Vlasenko
7510384107 do not do utime() on links, it acts on link targets, and we don't want that.
rename link_name to link_target, less confusing this way.
2007-06-20 14:49:47 +00:00
Denis Vlasenko
3ad5d0cbbe diff: shrink code (-85 bytes):
function                                             old     new   delta
fiddle_sum                                             8       -      -8
diffreg                                             2717    2690     -27
prepare                                              334     284     -50
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 0/2 up/down: 0/-85)             Total: -85 bytes

s/ATTRIBUTE_ALWAYS_INLINE/ALWAYS_INLINE/g
2007-06-12 20:54:54 +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
e8a0788b24 moved biggest stack buffers to malloc space, or made their size configurable
(8k of shell line edit buffer is an overkill)

# make ARCH=i386 bloatcheck
function                                             old     new   delta
read_line_input                                     3933    3967     +34
ifaddrlist                                           348     345      -3
do_loadfont                                          208     191     -17
edit_file                                            840     819     -21
.rodata                                           129112  129080     -32
uncompress                                          1305    1268     -37
loadfont_main                                        566     495     -71
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/6 up/down: 34/-181)          Total: -147 bytes
2007-06-10 15:08:44 +00:00
Denis Vlasenko
c14d39e83a rmp: add optional support for bz2 data. +50 bytes of code 2007-06-08 13:05:39 +00:00
Bernhard Reutner-Fischer
6c501a71ae - kiltedknight writes: Busybox incorrectly parses a line from the status file, claiming that a required package is not installed or tagged to be installed when it actually is.
Closes #1221
2007-06-05 17:28:56 +00:00
Bernhard Reutner-Fischer
fa5f20755c - fix typo in error message. Closes #1308 2007-06-05 17:07:01 +00:00
Denis Vlasenko
74324c8666 Audit bb_common_bufsiz usage, add script which looks for misuse.
tr: stop using globals needlessly.
code: -103 bytes
2007-06-04 10:16:52 +00:00
Denis Vlasenko
9a7d38fe24 delete tons of extra #includes 2007-05-31 22:42:12 +00:00
Denis Vlasenko
fad2b86c9e use "glibc errno" trick not only for ash, but for entire busybox
(add/remove: 1/1 grow/shrink: 37/37 up/down: 139/-228)        Total: -89 bytes
2007-05-31 22:16:38 +00:00
Denis Vlasenko
4b924f3a5c whitespace fixes 2007-05-30 00:29:55 +00:00
Denis Vlasenko
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
ac678ec2f1 style fixes, no code changes 2007-04-16 22:32:04 +00:00
Denis Vlasenko
334fa9bcb5 dpkg: use nitfields which are a bit closer to typical ushort.
Code size -800.
2007-04-13 23:22:58 +00:00
Denis Vlasenko
87468857f6 style fixes 2007-04-13 23:22:00 +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
c6758a07c6 make compressed help code NOMMU- and NOFORK-friendly -
no forking anymore, bunzip2 unpack routine now does all it in memory.
2007-04-10 21:40:19 +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
246b5c3916 one-liner: fix indentation 2007-04-10 17:18:12 +00:00
Denis Vlasenko
b38cf3ff8a bunzip2: big style cleanup. No code changes apart from one s/write/safe_write/
(verified with objdump).
2007-04-10 17:16:33 +00:00
Denis Vlasenko
8d9f495d68 getopt32: fix llist_t options ordering. llist_rev is not unused.
function                                             old     new   delta
tar_main                                             705     695     -10
sort_main                                            928     918     -10
decode_format_string                                 886     876     -10
run_parts_main                                       197     185     -12
ps_main                                              513     500     -13
wget_main                                           2764    2750     -14
awk_main                                            1014    1000     -14
od_main                                             2886    2866     -20
llist_rev                                             25       -     -25
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 0/8 up/down: 0/-128)           Total: -128 bytes
2007-04-08 15:08:42 +00:00
Denis Vlasenko
bbd695d801 find: fix handling of -prune
recursive_actions: uppercase flag constants
2007-04-08 10:52:28 +00:00
Denis Vlasenko
04c99ebb4f random small shrinkage and elimination of statics 2007-04-07 00:44:31 +00:00
Denis Vlasenko
1bb552b1d9 libbb: add xunlink()
patch: do not try to delete same file twice
2007-04-05 21:25:15 +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
666c40c9fc unzip: fix xstrndup bug (xstrndup(s,n) can allocate less than n bytes!) 2007-03-31 10:17:24 +00:00
Denis Vlasenko
53f83d68fb dpkg: run_package_script() returns 0 if all ok and non-zero if failure.
The result code was checked incorrectly in two places.
(from "Kim B. Heino" <Kim.Heino@bluegiga.com>)
2007-03-29 19:42:19 +00:00
Bernhard Reutner-Fischer
3e816c1252 - fold recurse, depthFirst and dereference params into one param flags.
Minor size improvement (-16b for size, -24b according to bloat-o-meter).
2007-03-29 10:30:50 +00:00
Denis Vlasenko
53091ecd20 Attempt to get more applets compile for NOMMU.
TODO_config_nommu documents what I managed to compile so far
(yay! msh works! cool). inetd, telnetd, httpd still do not compile. TODO
Also make fork(), daemon() produce warnings on compile stage
(in addition to erros on link stage).
2007-03-26 13:35:09 +00:00
Denis Vlasenko
cbcff2936e gzip: fix -d option handling 2007-03-22 18:56:23 +00:00
Denis Vlasenko
c86e052b81 fix accumulated whitespace and indentation damage 2007-03-20 11:30:28 +00:00
Denis Vlasenko
88a2aa98e0 dpkg: free_package(NULL) is ok, so don't test for NULL, just free. 2007-03-19 21:48:56 +00:00
Denis Vlasenko
97fd6d81b4 ls: fix segfault-if-standalone-shell, add big fat comment. 2007-03-19 20:59:20 +00:00
Bernhard Reutner-Fischer
de8a6a01d8 Kim B. Heino writes:
When installing a new package with dpkg dependencies are checked 
correctly. But when I try to update an existing package, the 
dependencies are checked against the old package, not against new 
package. Thus the new package can break dependencies.
2007-03-19 13:44:18 +00:00
Denis Vlasenko
3ce293b585 gunzip: s/unsigned char extra_short/unsigned extra_short/
we can unzip openssh-4.3p2.tar.gz now :)
2007-03-15 23:30:18 +00:00
Denis Vlasenko
bff32ce4d5 gzip: Improve ptr_to_globals trick, allowing gcc
to optimize better. -480 bytes.
2007-03-15 19:48:35 +00:00
Denis Vlasenko
24af7201e9 fix TODO: getopt32 should reset optind to 1 itself 2007-03-15 13:28:46 +00:00
Denis Vlasenko
972288e62f modify ptr_to_globals trick so that we do not violate
type safety (well, sort of ;))
2007-03-15 00:57:01 +00:00
Denis Vlasenko
650a0459b8 get_header_ar: reformatted code, no real changes 2007-03-14 22:08:53 +00:00
Denis Vlasenko
fe42d17318 gzip: bbunzip integration fixes 2007-03-14 00:08:28 +00:00
Denis Vlasenko
75605788ff gzip: use common bbunzip infrastructure - ~700 bytes code less 2007-03-14 00:07:51 +00:00
Denis Vlasenko
07766bb0e7 gzip: reduce global data footprint, part 3 2007-03-14 00:06:51 +00:00
Denis Vlasenko
da799e8227 gzip: reduce global data footprint, part 2 2007-03-14 00:06:29 +00:00
Denis Vlasenko
e930fe1441 gzip: reduce global data footprint, part 1 2007-03-14 00:06:10 +00:00
Denis Vlasenko
214aec46bd bbunzip: remove extra formatting directives in comments 2007-03-12 11:31:17 +00:00
Denis Vlasenko
baca175912 kill superfluous returns at the end of void functions 2007-03-11 13:43:10 +00:00
Denis Vlasenko
a4688bf55d fix buglets found by randomconfig run 2007-03-11 10:56:37 +00:00
Denis Vlasenko
bebbd8c9ba bbunzip: size optimization: ~90 bytes 2007-03-09 20:49:55 +00:00
Denis Vlasenko
6c939e0cb4 bbunzip: fix comments to match reality 2007-03-07 23:22:47 +00:00
Denis Vlasenko
ab9eef21a5 bunzip2/gunzip/uncompress/unlzma: merge into common code -
fix few corner cases, reduce size by 450 bytes. Update testsuite.
2007-03-07 22:02:23 +00:00
Denis Vlasenko
940494f813 remove f words 2007-03-04 18:09:50 +00:00
Denis Vlasenko
dcbd51dd28 tar: handle tarfiles with (broken) checksums a-la Sun. 2007-03-03 20:06:59 +00:00
Denis Vlasenko
54cf511ce1 sort: fix multiple -k (was ignoring all except last) 2007-02-17 18:11:45 +00:00
Denis Vlasenko
7fd00cbff7 dpkg: fix segfault on "dpkg -i" 2007-02-15 21:19:50 +00:00
Denis Vlasenko
e54b472ffc make tar restore mode again 2007-02-12 22:06:56 +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
1d76f439da EXEC_PREFER_APPLETS support by Gabriel L. Somlo <somlo@cmu.edu> 2007-02-06 01:20:12 +00:00
Denis Vlasenko
8c0164c373 fix tar t segfault (closes 1183) 2007-02-04 21:30:35 +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
b6aae0f381 preparatory patch for -Wwrite-strings #2 2007-01-29 22:51:25 +00:00
Denis Vlasenko
a41fdf331a preparatory patch for -Wwrite-strings #1 2007-01-29 22:51:00 +00:00
Denis Vlasenko
218f2f4882 accumulated post-1.4.0 fixes 2007-01-24 22:02:01 +00:00
Denis Vlasenko
150f402b36 whitespace fixes (leading spaces to tab) 2007-01-13 21:06:21 +00:00
Denis Vlasenko
f7996f3b70 Trailing whitespace removal over entire tree 2007-01-11 17:20:00 +00:00
Denis Vlasenko
1a8bf7f5d3 missed a few #undefs (no real impact I think) 2007-01-10 20:57:03 +00:00
Denis Vlasenko
7573541f74 fix bug 1146 (gunzip breakage introduced by me --vda) 2007-01-10 20:50:04 +00:00
Denis Vlasenko
db6a5c3f9e gzip cleanup part #13 - the last for today I think 2007-01-07 19:45:51 +00:00
Denis Vlasenko
3ae6f34135 gzip cleanup part #12 2007-01-07 19:44:57 +00:00
Denis Vlasenko
2f6df7fa0a gzip cleanup part #11 2007-01-07 19:44:35 +00:00
Denis Vlasenko
56c83eaaf5 gzip cleanup part #10 2007-01-07 19:40:50 +00:00
Denis Vlasenko
89af56b3e5 gzip cleanup part #9 2007-01-07 19:40:34 +00:00
Denis Vlasenko
52933d47bd gzip cleanup part #8 2007-01-07 19:40:13 +00:00
Denis Vlasenko
ef87d46b8c gzip cleanup part #7 2007-01-07 19:39:54 +00:00
Denis Vlasenko
1a03c21adf gzip cleanup part #6 2007-01-07 19:39:34 +00:00
Denis Vlasenko
da31fbc1b1 gzip cleanup part #5 2007-01-07 19:39:02 +00:00
Denis Vlasenko
f824136f6b gzip cleanup part #4 2007-01-07 19:38:42 +00:00
Denis Vlasenko
ed0f6db35e gzip cleanup part #3 2007-01-07 19:38:26 +00:00
Denis Vlasenko
30551fd6da gzip cleanup part #2 2007-01-07 19:38:06 +00:00
Denis Vlasenko
ad403413c7 a ton of gzip changes, split up in compiled and
run-tested pieces. Code was rather messy.
It's not a bug fix, more like code cleanup.

This is the first part.
2007-01-07 19:37:42 +00:00
Denis Vlasenko
da98165ad6 kill unused variable 2007-01-06 01:27:24 +00:00
Denis Vlasenko
c7a4aa5c99 move [g]zip decompressor state into malloc'ed buffer. size:
text    data     bss     dec     hex
5256       0     108    5364    14f4 - old
4915       0       0    4915    1333 - new
2007-01-06 00:03:11 +00:00
Denis Vlasenko
d1a19affeb split inflate_xx_setup() subroutines from inflate_xx() 2007-01-05 23:58:45 +00:00
Denis Vlasenko
cd42cb8df0 do not expose internal state of [g]zip unpacker.
fix memory leak in inflate_gunzip.
2007-01-05 23:56:53 +00:00
Denis Vlasenko
447b543eaf Stopped doing assignments inside expressions.
Who wrote this gem, I wonder?

n -= (e = (e = gunzip_wsize - ((d &= gunzip_wsize - 1) > w ? d : w)) > n ? n : e);
2007-01-05 19:49:02 +00:00
Denis Vlasenko
cc33ef12d2 decompress_unzip: preparatory patch 2007-01-05 19:46:04 +00:00
Denis Vlasenko
3376298b59 Stop tracking buffer size - it is a constant.
Stop ignoring write errors.
Fix bugs in this line:
rc->buffer_size = read(rc->fd, RC_BUFFER, rc->buffer_size);
(a) should use safe_read()
(b) just ONE short read (e.g. 4 bytes) will make ALL future reads short!
2007-01-05 14:04:47 +00:00
Denis Vlasenko
98b8e9487d simplify access to buffer, making code a bit smaller 2007-01-05 13:59:05 +00:00
Bernhard Reutner-Fischer
bfe1950c63 - spelling fix 2007-01-04 15:44:49 +00:00
Denis Vlasenko
bb3d0fab3b extern variable declaration in a .c file is heresy - fixing it 2007-01-03 01:57:25 +00:00
Denis Vlasenko
3bba545a54 done a dozen of randconfig test. guess what? ALL failed...
these are resulting fixes
2006-12-30 17:57:03 +00:00
Denis Vlasenko
9a44c4f91c bb_xget[pw/gr]nam were horribly misnamed - fixed.
uidgid_get -> get_uidgid, add additional param
(numeric_ok). Make chown use it.
chown: fix "chown user: ...."
install: fix incorrect use of bb_xget[pw/gr]nam
2006-12-28 05:44:47 +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
4cccc03768 remove useless casts (type*) xzalloc(...) 2006-12-22 18:37:07 +00:00
Denis Vlasenko
a6df5907d2 dpkg: getopt32-ification etc, -100 bytes 2006-12-22 18:32:40 +00:00
Denis Vlasenko
f4c52b32db rpm: reformat. was really hard to read 2006-12-22 15:03:50 +00:00
Denis Vlasenko
afc9ff99fd removal of commented-out cruft 2006-12-22 00:45:27 +00:00
Denis Vlasenko
714701c890 tar et al: die if bb_copyfd_size copies less than asked for.
(we have bb_copyfd_exact_size now for that kind of usage)
2006-12-22 00:21:07 +00:00
Denis Vlasenko
b95636c52f remove casts from xmalloc() 2006-12-19 23:36:04 +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
c88894602d tar: report error if child dies while writing out the end of tarball
(e.g. out of disk space).
2006-12-17 19:08:20 +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
a597aaddfa s/extern inline/static ATTRIBUTE_ALWAYS_INLINE/g
xstrtou: disallow leading '+'
2006-12-16 23:48:13 +00:00
Bernhard Reutner-Fischer
6f0540e7ec - remove functions marked as LEGACY in SUSv3 and use their modern counterparts. 2006-12-12 11:50:44 +00:00
Denis Vlasenko
c61852a02b fix support for globally disabling --long-options.
(disabling them saves ~4K on fully configured bbox)
2006-11-29 11:09:43 +00:00
Denis Vlasenko
30d7a346e6 tar: fix misplaced --exclude long option definition 2006-11-27 20:24:40 +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
cf749bc10c small fixes:
fix xstrdup to not grossly overallocate memory
use xopen instean of xopen3 in several places
etc.
2006-11-26 15:45:17 +00:00
Denis Vlasenko
c1660fea6d tar: refuse to untar files with "/../" components 2006-11-26 15:42:03 +00:00
Denis Vlasenko
b596335868 tar: correctly skip (and warn about) pax headers.
plug memory leak. save 50 bytes.
Wooohooo! we finally can unpack kernel tarballs!
2006-11-26 01:46:59 +00:00
Denis Vlasenko
7725d0ff5c tar: add support for FEATURE_TAR_GNU_EXTENSIONS so than we can save
long names now. We were able to read such tars, but not create.
+275 bytes. Without FEATURE_TAR_GNU_EXTENSIONS: -25 bytes.

We still cannot unpack Linux kernels, but not for long ;)
2006-11-25 23:56:50 +00:00
Denis Vlasenko
87cd4a87e3 tar: small fix and small optimization 2006-11-25 23:47:32 +00:00
Denis Vlasenko
f2408e6c3f tar: abort if tarring up file larger that 64Gb
(otherwise we will produce garbled tarfile)
2006-11-25 14:48:09 +00:00
Denis Vlasenko
3feb2fc535 tar: fix multiple -t and/or -v options handling.
do not process list of files to tar up in reverse order.
2006-11-24 21:55:55 +00:00
Denis Vlasenko
d031ffa623 tar: sanitize option handling 2006-11-24 21:54:44 +00:00