oweals/busybox.git
14 years agounicode: s/FEATURE_ASSUME_UNICODE/UNICODE_SUPPORT, add UNICODE_USING_LOCALE
Denys Vlasenko [Fri, 26 Mar 2010 13:06:56 +0000 (14:06 +0100)]
unicode: s/FEATURE_ASSUME_UNICODE/UNICODE_SUPPORT, add UNICODE_USING_LOCALE

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agounicode: optional table for better handling of neutral bidi chars
Tomas Heinrich [Fri, 26 Mar 2010 12:13:24 +0000 (13:13 +0100)]
unicode: optional table for better handling of neutral bidi chars

Off:
function                                             old     new   delta
unicode_bidi_isrtl                                     -      55     +55
isrtl_str                                             51      65     +14
unicode_isrtl                                         55       -     -55
read_line_input                                     5003    4937     -66
------------------------------------------------------------------------------
(add/remove: 1/4 grow/shrink: 1/1 up/down: 69/-121)           Total: -52 bytes

On:
function                                             old     new   delta
static.neutral_b                                       -     320    +320
static.neutral_p                                       -     142    +142
unicode_bidi_isrtl                                     -      55     +55
unicode_bidi_is_neutral_wchar                          -      55     +55
isrtl_str                                             51      59      +8
unicode_isrtl                                         55       -     -55
read_line_input                                     5003    4937     -66
------------------------------------------------------------------------------
(add/remove: 4/4 grow/shrink: 1/1 up/down: 580/-121)          Total: 459 bytes

Signed-off-by: Tomas Heinrich <heinrich.tomas@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoudhcp: cosmetic cleanups; one case of s/full_read/xread/
Denys Vlasenko [Fri, 26 Mar 2010 09:09:34 +0000 (10:09 +0100)]
udhcp: cosmetic cleanups; one case of s/full_read/xread/

function                                             old     new   delta
dumpleases_main                                      632     623      -9

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agounexpand: fix "a b"\n" input case
Tomas Heinrich [Fri, 26 Mar 2010 08:46:07 +0000 (09:46 +0100)]
unexpand: fix "a b"\n" input case

Signed-off-by: Tomas Heinrich <heinrich.tomas@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years ago[un]expand: account for different character widths. +16 bytes.
Tomas Heinrich [Fri, 26 Mar 2010 08:40:47 +0000 (09:40 +0100)]
[un]expand: account for different character widths. +16 bytes.

Signed-off-by: Tomas Heinrich <heinrich.tomas@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoudhcp: pass pointer to whole packet to "add option" functions
Denys Vlasenko [Fri, 26 Mar 2010 08:32:09 +0000 (09:32 +0100)]
udhcp: pass pointer to whole packet to "add option" functions

This is needed for "overflow option" support

function                                             old     new   delta
udhcp_find_option                                      -      34     +34
udhcp_add_binary_option                               94     106     +12
write_leases                                         227     223      -4
udhcp_init_header                                     86      82      -4
send_release                                         104      99      -5
init_packet                                           87      81      -6
add_client_options                                   160     154      -6
add_server_options                                   100      92      -8
udhcpd_main                                         1964    1954     -10
udhcpc_main                                         2859    2837     -22
find_option                                           34       -     -34
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 1/8 up/down: 46/-99)            Total: -53 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoudhcp: move options.c to common.c; disable unused bool and s16 option code
Denys Vlasenko [Fri, 26 Mar 2010 07:35:24 +0000 (08:35 +0100)]
udhcp: move options.c to common.c; disable unused bool and s16 option code

function                                             old     new   delta
udhcp_add_binary_option                                -      94     +94
udhcp_str2nip                                          -      42     +42
len_of_option_as_string                               12      10      -2
dhcp_option_lengths                                   12      10      -2
udhcpc_main                                         2859    2851      -8
read_nip                                              42       -     -42
xmalloc_optname_optval                               590     536     -54
udhcp_str2optset                                     443     366     -77
udhcp_add_option_string                               86       -     -86
------------------------------------------------------------------------------
(add/remove: 2/2 grow/shrink: 0/5 up/down: 136/-271)         Total: -135 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoudhcpc: add -x OPT:VAL option
Denys Vlasenko [Thu, 25 Mar 2010 19:32:38 +0000 (20:32 +0100)]
udhcpc: add -x OPT:VAL option

function                                             old     new   delta
udhcp_str2optset                                       -     443    +443
add_client_options                                     -     160    +160
udhcpc_main                                         2753    2857    +104
packed_usage                                       26670   26689     +19
attach_option                                        380     385      +5
udhcpd_main                                         1964    1965      +1
udhcp_add_option_string                               94      86      -8
add_param_req_option                                 128       -    -128
read_opt                                             443       -    -443
------------------------------------------------------------------------------
(add/remove: 2/2 grow/shrink: 4/1 up/down: 732/-579)          Total: 153 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoupdate defconfig
Bernhard Reutner-Fischer [Thu, 25 Mar 2010 13:15:24 +0000 (14:15 +0100)]
update defconfig

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
14 years agoremove ar write support from TODO
Bernhard Reutner-Fischer [Thu, 25 Mar 2010 13:15:04 +0000 (14:15 +0100)]
remove ar write support from TODO

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
14 years agoudhcp: add testing bits to dns en/decoder
Denys Vlasenko [Wed, 24 Mar 2010 15:43:16 +0000 (16:43 +0100)]
udhcp: add testing bits to dns en/decoder

we had two bugs there at least, must have testing

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoudhcp: we call DNS name encoder with NULL, this can SEGV. added a check
Denys Vlasenko [Wed, 24 Mar 2010 15:11:32 +0000 (16:11 +0100)]
udhcp: we call DNS name encoder with NULL, this can SEGV. added a check

function                                             old     new   delta
dname_enc                                            418     415      -3

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoudhcp: fix DNS domanin codec bug: bad compression flag checks
Denys Vlasenko [Wed, 24 Mar 2010 14:06:23 +0000 (15:06 +0100)]
udhcp: fix DNS domanin codec bug: bad compression flag checks

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years ago*: merge some common strings
Denys Vlasenko [Tue, 23 Mar 2010 15:25:17 +0000 (16:25 +0100)]
*: merge some common strings

   text   data    bss    dec    hexfilename
 838650   8009      0 846659  ceb43busybox_old
 838519   8009      0 846528  ceac0busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoudhcp: handle errors in read_staticlease
Denys Vlasenko [Tue, 23 Mar 2010 14:43:08 +0000 (15:43 +0100)]
udhcp: handle errors in read_staticlease

also gets rid of ether-aton's static buffer in ether-wake:
   text   data    bss    dec    hexfilename
 838664    441   7572 846677  ceb55busybox_old
 838650    441   7564 846655  ceb3fbusybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agobrctl: fixing stp parameters incompatibility
Maciek Borzecki [Tue, 23 Mar 2010 04:18:38 +0000 (05:18 +0100)]
brctl: fixing stp parameters incompatibility

function                                             old     new   delta
static.stp_opts                                        -      23     +23
brctl_main                                          1148    1169     +21
packed_usage                                       26786   26794      +8
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 2/0 up/down: 52/0)               Total: 52 bytes

Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agolsusb: 2.6.32 compat
Souf Oued [Tue, 23 Mar 2010 04:06:37 +0000 (05:06 +0100)]
lsusb: 2.6.32 compat

Signed-off-by: Souf Oued <souf_oued@yahoo.fr>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoudhcp: code shrink
Denys Vlasenko [Tue, 23 Mar 2010 03:31:38 +0000 (04:31 +0100)]
udhcp: code shrink

function                                             old     new   delta
attach_option                                          -     380    +380
read_opt                                             859     443    -416
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/1 up/down: 380/-416)          Total: -36 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoudhcp: remove two unused fields
Denys Vlasenko [Tue, 23 Mar 2010 01:17:52 +0000 (02:17 +0100)]
udhcp: remove two unused fields

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoash,hush: make it possible to build them individually
Denys Vlasenko [Tue, 23 Mar 2010 00:08:26 +0000 (01:08 +0100)]
ash,hush: make it possible to build them individually

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agodate,touch: accept Jan 7 00:00:00 2010 format
Alexander Shishkin [Mon, 22 Mar 2010 17:22:33 +0000 (18:22 +0100)]
date,touch: accept Jan 7 00:00:00 2010 format

function                                             old     new   delta
parse_datestr                                        618     647     +29

Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoudhcp: make rfc derived doc more readable (but it still is contradictory)
Denys Vlasenko [Mon, 22 Mar 2010 14:22:14 +0000 (15:22 +0100)]
udhcp: make rfc derived doc more readable (but it still is contradictory)

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoudhcp: merge options.h into common.h, script.c into dhcpc.c
Denys Vlasenko [Mon, 22 Mar 2010 13:29:13 +0000 (14:29 +0100)]
udhcp: merge options.h into common.h, script.c into dhcpc.c

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoudhcpc: do not test for srand init, just do it at the start
Denys Vlasenko [Mon, 22 Mar 2010 12:44:09 +0000 (13:44 +0100)]
udhcpc: do not test for srand init, just do it at the start

function                                             old     new   delta
udhcpc_main                                         2855    2867     +12
static.initialized                                     1       -      -1
client_background                                     32      31      -1
perform_release                                      124     122      -2
random_xid                                            38       -     -38
------------------------------------------------------------------------------
(add/remove: 0/2 grow/shrink: 1/2 up/down: 12/-42)            Total: -30 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoudhcp: merge clientpacket.c into dhcpc.c
Denys Vlasenko [Mon, 22 Mar 2010 12:43:12 +0000 (13:43 +0100)]
udhcp: merge clientpacket.c into dhcpc.c

function                                             old     new   delta
udhcpc_main                                         2569    2855    +286
perform_release                                      122     124      +2
client_background                                     31      32      +1
init_packet                                          156      88     -68
send_decline                                         114       -    -114
send_discover                                        121       -    -121
send_select                                          130       -    -130
------------------------------------------------------------------------------
(add/remove: 0/4 grow/shrink: 3/1 up/down: 289/-433)         Total: -144 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoudhcpc: merge clientsocket.c into dhcpc.c. +4 bytes.
Denys Vlasenko [Mon, 22 Mar 2010 12:42:13 +0000 (13:42 +0100)]
udhcpc: merge clientsocket.c into dhcpc.c. +4 bytes.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoflock: should not be selected by default
Denys Vlasenko [Sun, 21 Mar 2010 18:12:03 +0000 (19:12 +0100)]
flock: should not be selected by default

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agotouch: do not ignore argument of -d/-t option
Mikhail Gusarov [Sun, 21 Mar 2010 08:22:47 +0000 (14:22 +0600)]
touch: do not ignore argument of -d/-t option

Previously -d/-t was no-op due to wrong handling of args passed to
utimes(2).

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agodhcpd: apparently, sometimes IP is in ciaddr, not requested_ip...
Denys Vlasenko [Sun, 21 Mar 2010 05:46:09 +0000 (06:46 +0100)]
dhcpd: apparently, sometimes IP is in ciaddr, not requested_ip...

also revert the part which appempted to "fix" that in client

function                                             old     new   delta
udhcpd_main                                         1949    1964     +15
send_renew                                           142     105     -37
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 15/-37)            Total: -22 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoudhcpd: untangle incredibly messy handling of DHCPREQUEST
Denys Vlasenko [Sun, 21 Mar 2010 05:15:28 +0000 (06:15 +0100)]
udhcpd: untangle incredibly messy handling of DHCPREQUEST

Also fixes attacks possible via DHCPDECLINE / DHCPRELEASE

function                                             old     new   delta
udhcpd_main                                         1846    1949    +103
send_renew                                           105     142     +37
send_NAK                                              61       -     -61
send_ACK                                             180       -    -180
------------------------------------------------------------------------------
(add/remove: 0/2 grow/shrink: 2/0 up/down: 140/-241)         Total: -101 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoudhcp: tweak udhcpd.conf example and comments. no code changes
Denys Vlasenko [Sun, 21 Mar 2010 01:22:07 +0000 (02:22 +0100)]
udhcp: tweak udhcpd.conf example and comments. no code changes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoudhcp: code shrink; disable time and log server options
Denys Vlasenko [Sat, 20 Mar 2010 23:43:11 +0000 (00:43 +0100)]
udhcp: code shrink; disable time and log server options

function                                             old     new   delta
add_server_options                                     -     100    +100
udhcp_add_simple_option                               92      90      -2
nobody_responds_to_arp                                88      85      -3
dhcp_options                                          66      62      -4
udhcp_add_option_string                              104      94     -10
udhcp_run_script                                     665     654     -11
dhcp_option_strings                                  203     188     -15
static.blank_chaddr                                   16       -     -16
send_ACK                                             211     180     -31
add_bootp_options                                     61       -     -61
udhcpd_main                                         1925    1846     -79
------------------------------------------------------------------------------
(add/remove: 1/2 grow/shrink: 0/8 up/down: 100/-232)         Total: -132 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoudhcpc: make it possible to disable vendor id; improve help text
Denys Vlasenko [Sat, 20 Mar 2010 17:06:23 +0000 (18:06 +0100)]
udhcpc: make it possible to disable vendor id; improve help text

function                                             old     new   delta
init_packet                                          135     139      +4
packed_usage                                       26789   26786      -3
alloc_dhcp_option                                     67      63      -4
udhcpc_main                                         2467    2447     -20
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/3 up/down: 4/-27)             Total: -23 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoudhcpd: remove five more options which do not make sense or not supported
Denys Vlasenko [Sat, 20 Mar 2010 06:12:21 +0000 (07:12 +0100)]
udhcpd: remove five more options which do not make sense or not supported

requestip, vendorclass, clientid are client-side variables,
          they do not make sense as udhcpd opts
dhcptype  is the packet type (not interesting, it's always 5)
userclass needs parser support in order to work

function                                             old     new   delta
dhcp_options                                          68      66      -2
read_opt                                             865     859      -6
dhcp_option_strings                                  253     203     -50
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-58)             Total: -58 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoudhcpd: remove redundant code in send_offer()
Denys Vlasenko [Sat, 20 Mar 2010 02:49:27 +0000 (03:49 +0100)]
udhcpd: remove redundant code in send_offer()

static_lease_nip and lease pointer are canculated in the caller,
no need to calculate them again. lease_time_sec calculation
is also redundant: it is assigned to later, w/o being used
in between.

function                                             old     new   delta
udhcpd_main                                         1956    1925     -31

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoudhcp: move serverpacket.c into dhcpd.c, no other changes
Denys Vlasenko [Sat, 20 Mar 2010 02:48:11 +0000 (03:48 +0100)]
udhcp: move serverpacket.c into dhcpd.c, no other changes

function                                             old     new   delta
udhcpd_main                                         1480    1956    +476
send_inform                                           83       -     -83
send_offer                                           376       -    -376
------------------------------------------------------------------------------
(add/remove: 0/3 grow/shrink: 1/0 up/down: 476/-459)           Total: 17 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoflock: better help text
Denys Vlasenko [Fri, 19 Mar 2010 23:07:11 +0000 (00:07 +0100)]
flock: better help text

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoudhcp: remove support for some really old and odd options
Denys Vlasenko [Fri, 19 Mar 2010 22:42:23 +0000 (23:42 +0100)]
udhcp: remove support for some really old and odd options

function                                             old     new   delta
dhcp_options                                          72      68      -4
dhcp_option_strings                                  271     253     -18

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agotar: optional support for restoring selinux context
J. Tang [Fri, 19 Mar 2010 13:48:51 +0000 (14:48 +0100)]
tar: optional support for restoring selinux context

function                                             old     new   delta
get_header_tar                                      1690    1976    +286
data_extract_all                                     821     881     +60
.rodata                                           151446  151503     +57
get_header_cpio                                     1044    1077     +33
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/0 up/down: 436/0)             Total: 436 bytes

Signed-off-by: J. Tang <tang@jtang.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agolibbb/copyfd.c: don't mmap a largish buffer if we only want to copy a few kb
Denys Vlasenko [Fri, 19 Mar 2010 13:34:30 +0000 (14:34 +0100)]
libbb/copyfd.c: don't mmap a largish buffer if we only want to copy a few kb

function                                             old     new   delta
bb_full_fd_action                                    283     295     +12

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoflock: new applet
Timo Teras [Thu, 18 Mar 2010 21:45:35 +0000 (22:45 +0100)]
flock: new applet

function                                             old     new   delta
flock_main                                             -     253    +253
packed_usage                                       26466   26498     +32
applet_names                                        2170    2176      +6
applet_main                                         1280    1284      +4
applet_nameofs                                       640     642      +2
applet_install_loc                                   160     161      +1
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 5/0 up/down: 298/0)             Total: 298 bytes

Signed-off-by: Timo Teras <timo.teras@iki.fi>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years ago*: code shrink and better "died from signal" reporting from wait4pid
Denys Vlasenko [Thu, 18 Mar 2010 21:44:00 +0000 (22:44 +0100)]
*: code shrink and better "died from signal" reporting from wait4pid

function                                             old     new   delta
parse                                                964     967      +3
udhcp_run_script                                     670     665      -5
singlemount                                          911     906      -5
mount_it_now                                         360     355      -5
inotifyd_main                                        521     516      -5
xspawn                                                21       -     -21
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/4 up/down: 3/-41)             Total: -38 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agolineedit: first shot at optional unicode bidi input support
Tomas Heinrich [Thu, 18 Mar 2010 17:35:37 +0000 (18:35 +0100)]
lineedit: first shot at optional unicode bidi input support

function                                             old     new   delta
read_line_input                                     4886    5003    +117
in_uint16_table                                        -      97     +97
in_interval_table                                      -      78     +78
static.rtl_b                                           -      68     +68
unicode_isrtl                                          -      55     +55
isrtl_str                                              -      51     +51
static.rtl_p                                           -      42     +42
unicode_conv_to_printable2                           633     477    -156
------------------------------------------------------------------------------
(add/remove: 6/0 grow/shrink: 1/1 up/down: 508/-156)          Total: 352 bytes

Signed-off-by: Tomas Heinrich <heinrich.tomas@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agolibbb/loop: comment out u32 hack
Denys Vlasenko [Thu, 18 Mar 2010 13:38:21 +0000 (14:38 +0100)]
libbb/loop: comment out u32 hack

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agobrctl: Fix comment
Bernhard Reutner-Fischer [Wed, 17 Mar 2010 10:23:04 +0000 (11:23 +0100)]
brctl: Fix comment

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
14 years agobrctl: fix parsing of timespec to allow 0 (setfd, sethello..)
Maciek Borzecki [Tue, 16 Mar 2010 11:41:29 +0000 (12:41 +0100)]
brctl: fix parsing of timespec to allow 0 (setfd, sethello..)

Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agomdev: fix a trivial SEGV
Denys Vlasenko [Tue, 16 Mar 2010 17:37:19 +0000 (18:37 +0100)]
mdev: fix a trivial SEGV

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agolibbb/getopt32.c: clear applet_long_options and opt_complementary after use
Denys Vlasenko [Tue, 16 Mar 2010 16:57:53 +0000 (17:57 +0100)]
libbb/getopt32.c: clear applet_long_options and opt_complementary after use

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoinclude/fix_u32.h: try harder to not cause redefinition errors
Denys Vlasenko [Tue, 16 Mar 2010 00:22:35 +0000 (01:22 +0100)]
include/fix_u32.h: try harder to not cause redefinition errors

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agotar compability modes for dpkg
Kim B. Heino [Mon, 8 Mar 2010 07:19:51 +0000 (09:19 +0200)]
tar compability modes for dpkg

I've found couple of deb files which require old tar compability modes
to be unpacked. This patch allows me to enable them for dpkg without
enabling tar.

Signed-off-by: Kim B. Heino <Kim.Heino@bluegiga.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoar: add archive creation support
Alexander Shishkin [Mon, 15 Mar 2010 14:38:09 +0000 (15:38 +0100)]
ar: add archive creation support

function                                             old     new   delta
ar_main                                              184     542    +358
output_ar_header                                       -     166    +166
copy_data                                              -      54     +54
filter_replaceable                                     -      19     +19
get_header_ar                                        409     414      +5
header_verbose_list_ar                                85      88      +3
static.msg_unsupported_err                            28       -     -28
------------------------------------------------------------------------------
(add/remove: 3/1 grow/shrink: 3/0 up/down: 605/-28)           Total: 577 bytes

Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agofbsplash: reinstate drawing of over/undersized images; shrink
Denys Vlasenko [Sun, 14 Mar 2010 22:59:54 +0000 (23:59 +0100)]
fbsplash: reinstate drawing of over/undersized images; shrink

Based on the patch by Nuno Lucas <ntlucas@gmail.com>

function                                             old     new   delta
fbsplash_main                                        938     864     -74

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agobeep: the -d option takes milliseconds not microseconds
Natanael Copa [Sun, 14 Mar 2010 14:32:49 +0000 (15:32 +0100)]
beep: the -d option takes milliseconds not microseconds

Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agotestsuite: don't run grep NUL tests when we know the would fail
Denys Vlasenko [Sat, 13 Mar 2010 23:51:56 +0000 (00:51 +0100)]
testsuite: don't run grep NUL tests when we know the would fail

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoash: fix quadratic matching slowdown is ${v/*foo*/repl} (really bad one)
Denys Vlasenko [Sat, 13 Mar 2010 15:19:04 +0000 (16:19 +0100)]
ash: fix quadratic matching slowdown is ${v/*foo*/repl} (really bad one)

It is especially bad with patterns starting with "*".

With ASH_OPTIMIZE_FOR_SIZE=y, only those are optimized, +few bytes:
   text    data     bss     dec     hex filename
 836337     441    7564  844342   ce236 busybox_old
 836341     441    7564  844346   ce23a busybox_unstripped

With ASH_OPTIMIZE_FOR_SIZE off, we also optimize patterns _ending_ with "*",
which costs about 80 bytes:
   text    data     bss     dec     hex filename
 836656     441    7564  844661   ce375 busybox_old
 836732     441    7564  844737   ce3c1 busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agotailk: fix error detected by testsuite
Denys Vlasenko [Fri, 12 Mar 2010 21:16:25 +0000 (22:16 +0100)]
tailk: fix error detected by testsuite

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoawk: code shrink
Denys Vlasenko [Fri, 12 Mar 2010 20:32:13 +0000 (21:32 +0100)]
awk: code shrink

function                                             old     new   delta
evaluate                                            3550    3487     -63

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoawk: code shrink
Denys Vlasenko [Fri, 12 Mar 2010 20:05:09 +0000 (21:05 +0100)]
awk: code shrink

function                                             old     new   delta
hash_find                                            233     234      +1
evaluate                                            3899    3550    -349

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoawk: style fixes
Denys Vlasenko [Fri, 12 Mar 2010 20:04:47 +0000 (21:04 +0100)]
awk: style fixes

function                                             old     new   delta
hash_find                                            234     233      -1
awk_printf                                           457     453      -4

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoawk: code shrink
Denys Vlasenko [Fri, 12 Mar 2010 15:57:06 +0000 (16:57 +0100)]
awk: code shrink

function                                             old     new   delta
exec_builtin                                        1538    1489     -49

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agolineedit: fix another corner case with bad unicode input
Denys Vlasenko [Thu, 11 Mar 2010 20:17:55 +0000 (21:17 +0100)]
lineedit: fix another corner case with bad unicode input

function                                             old     new   delta
read_key                                             607     646     +39
readit                                                50      55      +5
getch_nowait                                         290     295      +5
hash_find                                            233     234      +1
xstrtoul_range_sfx                                   231     230      -1
passwd_main                                         1058    1056      -2
builtin_exit                                          45      43      -2
cmp_main                                             649     645      -4
lineedit_read_key                                    257     245     -12
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/5 up/down: 50/-21)             Total: 29 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoawk: code shrink
Denys Vlasenko [Thu, 11 Mar 2010 11:44:25 +0000 (12:44 +0100)]
awk: code shrink

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoawk: code shrink; style fixes
Denys Vlasenko [Thu, 11 Mar 2010 11:41:55 +0000 (12:41 +0100)]
awk: code shrink; style fixes

function                                             old     new   delta
next_token                                           932     862     -70

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoawk: be more paranoid when freeing loop variable; make code less obfuscated
Denys Vlasenko [Thu, 11 Mar 2010 11:13:18 +0000 (12:13 +0100)]
awk: be more paranoid when freeing loop variable; make code less obfuscated

function                                             old     new   delta
nvfree                                               149     170     +21
next_token                                           928     932      +4
getvar_i                                              95      94      -1
skip_spaces                                           51      45      -6
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/2 up/down: 25/-7)              Total: 18 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoawk: add two tests we currently fail
Denys Vlasenko [Thu, 11 Mar 2010 07:27:53 +0000 (08:27 +0100)]
awk: add two tests we currently fail

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoawk: simple code shrink
Denys Vlasenko [Wed, 10 Mar 2010 18:21:54 +0000 (19:21 +0100)]
awk: simple code shrink

function                                             old     new   delta
awk_getline                                          710     724     +14
awk_printf                                           455     457      +2
hash_find                                            234     233      -1
qrealloc                                              33      31      -2
handle_special                                       499     482     -17
awk_sub                                              641     601     -40
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/4 up/down: 16/-60)            Total: -44 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoawk: fix the case where nested "for" loops with the same variable misbehave
Denys Vlasenko [Wed, 10 Mar 2010 18:20:32 +0000 (19:20 +0100)]
awk: fix the case where nested "for" loops with the same variable misbehave

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agopopmaildir: give examples in help text. +91 byte
Denys Vlasenko [Wed, 10 Mar 2010 12:01:14 +0000 (13:01 +0100)]
popmaildir: give examples in help text. +91 byte

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agolineedit: invalid unicode characters are replaced with CONFIG_SUBST_WCHAR
Tomas Heinrich [Tue, 9 Mar 2010 13:09:24 +0000 (14:09 +0100)]
lineedit: invalid unicode characters are replaced with CONFIG_SUBST_WCHAR

function                                             old     new   delta
read_key_ungets                                        -      50     +50
lineedit_read_key                                    223     252     +29

Signed-off-by: Tomas Heinrich <heinrich.tomas@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoshell/ulimit: code shrink by 10 bytes
Denys Vlasenko [Mon, 8 Mar 2010 22:28:30 +0000 (23:28 +0100)]
shell/ulimit: code shrink by 10 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agolibbb/loop.c: move #include to its user, improve comment
Denys Vlasenko [Mon, 8 Mar 2010 22:10:23 +0000 (23:10 +0100)]
libbb/loop.c: move #include to its user, improve comment

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agowc: compat: make "wc -c ONE_FILE" not print leading spaces. +2 bytes
Denys Vlasenko [Mon, 8 Mar 2010 21:03:24 +0000 (22:03 +0100)]
wc: compat: make "wc -c ONE_FILE" not print leading spaces. +2 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoinclude/fix_u32.h: fix trivial compile breakage :(
Denys Vlasenko [Mon, 8 Mar 2010 20:53:45 +0000 (21:53 +0100)]
include/fix_u32.h: fix trivial compile breakage :(

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agolibbb/loop.c: use common fix_u32.h trick
Denys Vlasenko [Sat, 6 Mar 2010 19:50:29 +0000 (20:50 +0100)]
libbb/loop.c: use common fix_u32.h trick

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agohush: use ash's ulimit builtin; make it more more bash0like while at it
Denys Vlasenko [Sat, 6 Mar 2010 19:12:00 +0000 (20:12 +0100)]
hush: use ash's ulimit builtin; make it more more bash0like while at it

Based on a patch by Tobias Klauser <tklauser@distanz.ch>

function                                             old     new   delta
shell_builtin_ulimit                                   -     498    +498
limits_tbl                                            33      88     +55
ulimit_opt_string                                      -      38     +38
bltins1                                              288     300     +12
limits_name                                          127       -    -127
ulimitcmd                                            415       7    -408
------------------------------------------------------------------------------
(add/remove: 3/1 grow/shrink: 2/1 up/down: 603/-535)           Total: 68 bytes
   text    data     bss     dec     hex filename
 839229     453    6828  846510   ceaae busybox_old
 839423     453    6828  846704   ceb70 busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agotftp: do not show progress bar if we get error right away. +13 bytes
Denys Vlasenko [Fri, 5 Mar 2010 22:38:54 +0000 (23:38 +0100)]
tftp: do not show progress bar if we get error right away. +13 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years ago*: use NULL for null pointers
Denys Vlasenko [Fri, 5 Mar 2010 13:10:54 +0000 (14:10 +0100)]
*: use NULL for null pointers

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agolibbb/loop.c: style and readability fixes, no code changes
Denys Vlasenko [Fri, 5 Mar 2010 12:20:28 +0000 (13:20 +0100)]
libbb/loop.c: style and readability fixes, no code changes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agotop: make 's' display easier to understand
Denys Vlasenko [Thu, 4 Mar 2010 11:50:59 +0000 (12:50 +0100)]
top: make 's' display easier to understand

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agomodprobe: remove 2k limit on /proc/cmdline
Denys Vlasenko [Wed, 3 Mar 2010 03:20:33 +0000 (04:20 +0100)]
modprobe: remove 2k limit on /proc/cmdline

function                                             old     new   delta
do_modprobe                                          365     520    +155
parse_and_add_kcmdline_module_options                149       -    -149

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoping: do not leak data from stack; shrink
Denys Vlasenko [Wed, 3 Mar 2010 00:10:29 +0000 (01:10 +0100)]
ping: do not leak data from stack; shrink

FANCY ping:
function                                             old     new   delta
common_ping_main                                     386    1732   +1346
sendping6                                             98      83     -15
sendping4                                            188     158     -30
ping4                                                575       -    -575
ping6                                                756       -    -756
------------------------------------------------------------------------------
(add/remove: 0/2 grow/shrink: 1/2 up/down: 1346/-1376)        Total: -30 bytes

!FANCY ping:
function                                             old     new   delta
hostname                                               4       -      -4
common_ping_main                                     566     499     -67

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agohead,tail: trim help text; make suffixes unconditional for head too
Denys Vlasenko [Tue, 2 Mar 2010 15:18:14 +0000 (16:18 +0100)]
head,tail: trim help text; make suffixes unconditional for head too

function                                             old     new   delta
packed_usage                                       26411   26375     -36

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years ago*: do not check for POLLIN/POLLOUT only, just in case it's POLHUP/POLERR
Denys Vlasenko [Tue, 2 Mar 2010 14:02:45 +0000 (15:02 +0100)]
*: do not check for POLLIN/POLLOUT only, just in case it's POLHUP/POLERR

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agosyslog: allow multiple -R options
Thomas Geulig [Sun, 28 Feb 2010 12:01:59 +0000 (13:01 +0100)]
syslog: allow multiple -R options

function                                             old     new   delta
syslogd_main                                        1082    1177     +95
init_data                                             72      64      -8

Signed-off-by: Thomas Geulig <geulig@nentec.de>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agomodprobe: pick up module options from /proc/cmdline too
Denys Vlasenko [Sat, 27 Feb 2010 22:15:22 +0000 (23:15 +0100)]
modprobe: pick up module options from /proc/cmdline too

Based on patch by Ozan Çağlayan (ozan AT pardus.org.tr)

function                                             old     new   delta
parse_and_add_kcmdline_module_options                  -     149    +149
do_modprobe                                          357     365      +8

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoMerge branch 'master' of git+ssh://vda@busybox.net/var/lib/git/busybox
Denys Vlasenko [Sat, 27 Feb 2010 22:15:22 +0000 (23:15 +0100)]
Merge branch 'master' of git+ssh://vda@busybox.net/var/lib/git/busybox

14 years ago*: gethostname-related fixes
Denys Vlasenko [Sat, 27 Feb 2010 18:38:19 +0000 (19:38 +0100)]
*: gethostname-related fixes

function                                             old     new   delta
hostname_main                                        218     231     +13
nfsmount                                            3541    3474     -67

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoConfig: fix alphabetical ordering
Bernhard Reutner-Fischer [Fri, 26 Feb 2010 18:33:49 +0000 (19:33 +0100)]
Config: fix alphabetical ordering

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
14 years agotail: document FANCY flags in helptext
Bernhard Reutner-Fischer [Fri, 26 Feb 2010 17:33:39 +0000 (18:33 +0100)]
tail: document FANCY flags in helptext

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
14 years agodf: explain FANCY options in helptext
Bernhard Reutner-Fischer [Fri, 26 Feb 2010 17:21:42 +0000 (18:21 +0100)]
df: explain FANCY options in helptext

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
14 years agoreuse a few strings
Bernhard Reutner-Fischer [Fri, 26 Feb 2010 09:09:31 +0000 (10:09 +0100)]
reuse a few strings

   text    data     bss     dec     hex filename
 839040     453    6828  846321   ce9f1 busybox_old
 839019     453    6828  846300   ce9dc busybox_unstripped

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agosu: move restricted_shell into su.c (the only user)
Denys Vlasenko [Fri, 26 Feb 2010 09:01:18 +0000 (10:01 +0100)]
su: move restricted_shell into su.c (the only user)

function                                             old     new   delta
su_main                                              448     468     +20
buffer_fill_and_print                                179     196     +17
scriptreplay_main                                    205     208      +3
localcmd                                             275     277      +2
hash_find                                            233     234      +1
devmem_main                                          469     463      -6
install_main                                         724     716      -8
setusershell                                          11       -     -11
find_pair                                            187     169     -18
restricted_shell                                      49       -     -49
------------------------------------------------------------------------------
(add/remove: 0/3 grow/shrink: 5/3 up/down: 43/-92)            Total: -49 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agosetup_environment(): eliminate one parameter
Denys Vlasenko [Fri, 26 Feb 2010 08:52:45 +0000 (09:52 +0100)]
setup_environment(): eliminate one parameter

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agocrontab: use setup_environment
Bernhard Reutner-Fischer [Wed, 24 Feb 2010 15:10:09 +0000 (16:10 +0100)]
crontab: use setup_environment

function                                             old     new   delta
setup_environment                                    184     198     +14
.rodata                                           131770  131747     -23
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 14/-23)             Total: -9 bytes

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
14 years agofree: silence warning about unused argv
Bernhard Reutner-Fischer [Fri, 26 Feb 2010 08:28:30 +0000 (09:28 +0100)]
free: silence warning about unused argv

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoawk: skip whitespace between array name and subscript
Alexander Shishkin [Thu, 25 Feb 2010 15:55:40 +0000 (17:55 +0200)]
awk: skip whitespace between array name and subscript

It is supported in both mawk and gawk and there are actually scripts
out there that use this "flexibility".

function                                             old     new   delta
next_token                                          1144    1152      +8
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/0 up/down: 8/0)                 Total: 8 bytes

Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agofind: tweak error message
Bernhard Reutner-Fischer [Thu, 25 Feb 2010 12:22:37 +0000 (13:22 +0100)]
find: tweak error message

big find:
find: missing argument to `-exec'
we now say
find: -exec requires an argument
instead of the cryptic message we emitted previously.
Additional benefit is that it's now 23 bytes smaller.

Add TODO to add '-exec {} +' support

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
14 years agotypo fixes
Denys Vlasenko [Wed, 24 Feb 2010 13:27:55 +0000 (14:27 +0100)]
typo fixes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agomdev: fix subsystem passing (new kernels broke it again) - bugs 639, 721.
Denys Vlasenko [Wed, 24 Feb 2010 09:39:47 +0000 (10:39 +0100)]
mdev: fix subsystem passing (new kernels broke it again) - bugs 639, 721.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agofdisk: do not treat names ending in '0' as partitions
Denys Vlasenko [Wed, 24 Feb 2010 07:13:30 +0000 (08:13 +0100)]
fdisk: do not treat names ending in '0' as partitions

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>