oweals/busybox.git
15 years agopasswd: do not complain if /etc/shadow is missing
Denys Vlasenko [Mon, 2 Nov 2009 18:18:49 +0000 (19:18 +0100)]
passwd: do not complain if /etc/shadow is missing

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agoudhcpc: log script parameter too
Denys Vlasenko [Mon, 2 Nov 2009 17:53:57 +0000 (18:53 +0100)]
udhcpc: log script parameter too

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agoinclude/libbb.h: mark malloc-returning functions with GCC attribute
Denys Vlasenko [Mon, 2 Nov 2009 13:20:34 +0000 (14:20 +0100)]
include/libbb.h: mark malloc-returning functions with GCC attribute

function                                             old     new   delta
ash_main                                            1336    1365     +29
readcmd                                             1062    1072     +10
add_split_dependencies                               707     717     +10
rtnl_talk                                            539     548      +9
normalize                                            165     174      +9
xmalloc_optname_optval                               583     590      +7
test_main                                            247     253      +6
insert_bg_job                                        366     371      +5
dname_enc                                            391     395      +4
nslookup_main                                        165     168      +3
ifplugd_main                                        1099    1102      +3
tftpd_main                                           493     495      +2
make_new_session                                     413     415      +2
localcmd                                             274     276      +2
date_main                                            696     698      +2
tee_main                                             317     318      +1
setvar                                               183     184      +1
hash_find                                            233     234      +1
xrtnl_dump_filter                                    400     399      -1
prepend_new_eth_table                                297     295      -2
unpack_Z_stream                                     1229    1226      -3
read_line_input                                     4823    4820      -3
do_load                                              523     520      -3
udhcp_run_script                                     669     665      -4
mkfs_vfat_main                                      1609    1605      -4
rtnl_rtprot_initialize                                70      65      -5
procps_scan                                         1842    1835      -7
read_opt                                             873     865      -8
ifupdown_main                                       2133    2125      -8
mkfs_ext2_main                                      2492    2482     -10
logread_main                                         503     492     -11
svlogd_main                                         1441    1429     -12
rewrite                                             1032    1018     -14
fbsplash_main                                        917     903     -14
str2sockaddr                                         431     405     -26
unpack_lzma_stream                                  2705    2677     -28
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 18/18 up/down: 106/-163)        Total: -57 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years ago*: introduce and use ffulsh_all()
Denys Vlasenko [Mon, 2 Nov 2009 13:19:51 +0000 (14:19 +0100)]
*: introduce and use ffulsh_all()

function                                             old     new   delta
buffer_fill_and_print                                179     196     +17
fflush_all                                             -       9      +9
spawn                                                 87      92      +5
rtcwake_main                                         455     453      -2
...
alarm_intr                                            93      84      -9
readcmd                                             1072    1062     -10
bb_ask                                               345     333     -12
more_main                                            845     832     -13
flush_stdout_stderr                                   42      23     -19
xfflush_stdout                                        27       -     -27
flush_stderr                                          30       -     -30
------------------------------------------------------------------------------
(add/remove: 1/2 grow/shrink: 2/50 up/down: 31/-397)         Total: -366 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agomkfs.reiser: new applet. needs much polishing
Vladimir Dronnikov [Mon, 2 Nov 2009 09:41:46 +0000 (10:41 +0100)]
mkfs.reiser: new applet. needs much polishing

Signed-off-by: Vladimir Dronnikov <dronnikov@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agobtrfs.c: check first two superblocks, for additional robustness
Denys Vlasenko [Sun, 1 Nov 2009 23:12:35 +0000 (00:12 +0100)]
btrfs.c: check first two superblocks, for additional robustness

function                                             old     new   delta
volume_id_probe_btrfs                                 94     142     +48

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agovolume_id: add FAST_FUNC where appropriate
Denys Vlasenko [Sun, 1 Nov 2009 22:07:18 +0000 (23:07 +0100)]
volume_id: add FAST_FUNC where appropriate

function                                             old     new   delta
volume_id_probe_iso9660                              324     327      +3
volume_id_probe_vfat                                 902     903      +1
volume_id_probe_udf                                  576     577      +1
volume_id_probe_ntfs                                 314     315      +1
uuidcache_check_device                               292     291      -1
volume_id_probe_xfs                                   87      85      -2
volume_id_probe_sysv                                 165     163      -2
volume_id_probe_romfs                                 89      87      -2
volume_id_probe_reiserfs                             236     234      -2
volume_id_probe_ocfs2                                 96      94      -2
volume_id_probe_luks                                  78      76      -2
volume_id_probe_linux_swap                           165     163      -2
volume_id_probe_jfs                                   96      94      -2
volume_id_probe_hfs_hfsplus                          795     793      -2
volume_id_probe_ext                                   82      80      -2
volume_id_probe_cramfs                                59      57      -2
volume_id_probe_btrfs                                 96      94      -2
free_volume_id                                        36      31      -5
volume_id_probe_linux_raid                           127     119      -8
volume_id_probe_all                                  152     138     -14
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/16 up/down: 6/-52)            Total: -46 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agovolume_id: add support for btrfs
Vladimir Dronnikov [Sun, 1 Nov 2009 22:05:09 +0000 (23:05 +0100)]
volume_id: add support for btrfs

function                                             old     new   delta
volume_id_probe_btrfs                                  -      96     +96
fs2                                                   48      52      +4
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/0 up/down: 100/0)             Total: 100 bytes

Signed-off-by: Vladimir Dronnikov <dronnikov@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agomdev: do not die on mknod errors
Denys Vlasenko [Sun, 1 Nov 2009 20:51:31 +0000 (21:51 +0100)]
mdev: do not die on mknod errors

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agomountpoint: btrfs fix
Vladimir Dronnikov [Sun, 1 Nov 2009 03:33:23 +0000 (04:33 +0100)]
mountpoint: btrfs fix

Signed-off-by: Vladimir Dronnikov <dronnikov@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agoAdd more compat code for non GNU environments
Dan Fandrich [Sun, 1 Nov 2009 03:01:30 +0000 (04:01 +0100)]
Add more compat code for non GNU environments

Signed-off-by: Dan Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agotty: use defines rather than constants
Bernhard Reutner-Fischer [Thu, 29 Oct 2009 20:37:48 +0000 (21:37 +0100)]
tty: use defines rather than constants

No obj-code changes.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
15 years ago*: random code shrink
Denys Vlasenko [Thu, 29 Oct 2009 12:27:31 +0000 (13:27 +0100)]
*: random code shrink

function                                             old     new   delta
alarm_handler                                         50      46      -4
ask                                                  228     211     -17
rtcwake_main                                         474     455     -19

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agolineedit: REALLY fix compile error now
Denys Vlasenko [Thu, 29 Oct 2009 02:45:26 +0000 (03:45 +0100)]
lineedit: REALLY fix compile error now

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agolineedit: compile fix
Denys Vlasenko [Thu, 29 Oct 2009 02:41:38 +0000 (03:41 +0100)]
lineedit: compile fix

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agoecho et al: support \e escape
Denys Vlasenko [Thu, 29 Oct 2009 02:39:55 +0000 (03:39 +0100)]
echo et al: support \e escape

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agowall: new applet
Bernhard Reutner-Fischer [Mon, 26 Oct 2009 22:29:03 +0000 (23:29 +0100)]
wall: new applet

text    data     bss     dec     hex filename
     81       0       0      81      51 miscutils/wall.o

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agoadd and use xopen_nonblocking (-18b)
Bernhard Reutner-Fischer [Mon, 26 Oct 2009 22:27:08 +0000 (23:27 +0100)]
add and use xopen_nonblocking (-18b)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agochpst: tiny shrinkage and add possible TODO
Bernhard Reutner-Fischer [Mon, 26 Oct 2009 22:27:07 +0000 (23:27 +0100)]
chpst: tiny shrinkage and add possible TODO

text    data     bss     dec     hex filename
1398       0       0    1398     576 runit/chpst.o.old
1385       0       0    1385     569 runit/chpst.o

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agomdev: adjust error message
Bernhard Reutner-Fischer [Mon, 26 Oct 2009 22:27:06 +0000 (23:27 +0100)]
mdev: adjust error message

function                                             old     new   delta
.rodata                                           126715  126706      -9

(reusing common error string)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agomdev: handle string modes
Bernhard Reutner-Fischer [Mon, 26 Oct 2009 22:27:05 +0000 (23:27 +0100)]
mdev: handle string modes

parse ugoa=rwxXst via bb_parse_mode (+5b)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agomdev: tiny shrinkage by index_in_strings
Bernhard Reutner-Fischer [Mon, 26 Oct 2009 22:27:04 +0000 (23:27 +0100)]
mdev: tiny shrinkage by index_in_strings

text    data     bss     dec     hex filename
      2633       0       0    2633     a49 util-linux/mdev.o.old
      2624       0       0    2624     a40 util-linux/mdev.o

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agoapplets/usage_compressed: combine many seds in one; hide dd stats
Bernhard Reutner-Fischer [Tue, 27 Oct 2009 16:05:31 +0000 (17:05 +0100)]
applets/usage_compressed: combine many seds in one; hide dd stats

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agoplatform compatibility work (by Dan Fandrich)
Dan Fandrich [Tue, 27 Oct 2009 10:05:00 +0000 (11:05 +0100)]
platform compatibility work (by Dan Fandrich)

Signed-off-by: Dan Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agorename sent_ESC_br_n6 variable to sent_ESC_br6n
Denys Vlasenko [Tue, 27 Oct 2009 09:47:49 +0000 (10:47 +0100)]
rename sent_ESC_br_n6 variable to sent_ESC_br6n

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agolibbb/lineedit: try to make FEATURE_EDITING_ASK_TERMINAL less ugly
Denys Vlasenko [Tue, 27 Oct 2009 09:34:06 +0000 (10:34 +0100)]
libbb/lineedit: try to make FEATURE_EDITING_ASK_TERMINAL less ugly

function                                             old     new   delta
read_line_input                                     4809    4829     +20
lineedit_read_key                                    207     223     +16
put_prompt                                           110     117      +7
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/0 up/down: 43/0)               Total: 43 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agolibbb/xrealloc_vector.c: better comment
Denys Vlasenko [Tue, 27 Oct 2009 09:01:01 +0000 (10:01 +0100)]
libbb/xrealloc_vector.c: better comment

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agolibbb/bb_do_delay.c: shrink
Denys Vlasenko [Tue, 27 Oct 2009 08:54:34 +0000 (09:54 +0100)]
libbb/bb_do_delay.c: shrink

function                                             old     new   delta
difftime                                               9       -      -9
bb_do_delay                                           88      38     -50
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 0/1 up/down: 0/-59)             Total: -59 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agolibbb/ask_confirmation.c: shrink
Denys Vlasenko [Tue, 27 Oct 2009 08:49:04 +0000 (09:49 +0100)]
libbb/ask_confirmation.c: shrink

function                                             old     new   delta
bb_ask_confirmation                                   95      76     -19

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agohttpd_indexcgi: fix off-by-one error
Denys Vlasenko [Tue, 27 Oct 2009 08:29:01 +0000 (09:29 +0100)]
httpd_indexcgi: fix off-by-one error

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agosed: shrink usage text
Denys Vlasenko [Tue, 27 Oct 2009 08:11:17 +0000 (09:11 +0100)]
sed: shrink usage text

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agoMinor usage tweak for sed.
Rob Landley [Mon, 26 Oct 2009 21:04:07 +0000 (16:04 -0500)]
Minor usage tweak for sed.

Makes it slightly smaller and (in my opinion) clearer.

Signed-off-by: Rob Landley <rob@landley.net>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agoread_key,lineeedit: parse position answerback faster; sanitize its use
Denys Vlasenko [Mon, 26 Oct 2009 14:23:32 +0000 (15:23 +0100)]
read_key,lineeedit: parse position answerback faster; sanitize its use

it's still not reliable, and probably cannot be made so...
added comment with explanation.

function                                             old     new   delta
put_prompt                                            52     110     +58
read_key                                             601     607      +6
lineedit_read_key                                    201     207      +6
win_changed                                          108     104      -4
read_line_input                                     4824    4809     -15
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/2 up/down: 70/-19)             Total: 51 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agolsmod: unicode-aware column formatting
Tomas Heinrich [Mon, 19 Oct 2009 21:58:31 +0000 (23:58 +0200)]
lsmod: unicode-aware column formatting

Signed-off-by: Tomas Heinrich <heinrich.tomas@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agoread_key: ignore unknown keys (do not return them to caller byte-by-byte)
Denys Vlasenko [Mon, 26 Oct 2009 11:09:06 +0000 (12:09 +0100)]
read_key: ignore unknown keys (do not return them to caller byte-by-byte)

function                                             old     new   delta
read_key                                             568     601     +33

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agoread_key: remove handling for ctrl-up/down, we don't use that. -12 bytes
Denys Vlasenko [Sun, 25 Oct 2009 23:59:59 +0000 (00:59 +0100)]
read_key: remove handling for ctrl-up/down, we don't use that. -12 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agoread_key: document more weird key sequences
Denys Vlasenko [Sun, 25 Oct 2009 23:50:52 +0000 (00:50 +0100)]
read_key: document more weird key sequences

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agolineedit: handle Ctrl-arrows
Denys Vlasenko [Sun, 25 Oct 2009 22:50:56 +0000 (23:50 +0100)]
lineedit: handle Ctrl-arrows

function                                             old     new   delta
read_line_input                                     4629    4824    +195
BB_isalnum                                             -      39     +39
BB_ispunct                                             -      35     +35
BB_isspace                                             -      31     +31
static.esccmds                                        69      93     +24
vi_word_motion                                       165     162      -3
vi_back_motion                                       204     198      -6
vi_end_motion                                        172     163      -9
bb_iswspace                                           28       -     -28
bb_iswpunct                                           32       -     -32
bb_iswalnum                                           37       -     -37
------------------------------------------------------------------------------
(add/remove: 3/3 grow/shrink: 5/8 up/down: 334/-129)          Total: 205 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agomodutils: add FEATURE_INSMOD_TRY_MMAP option
Denys Vlasenko [Sun, 25 Oct 2009 03:35:22 +0000 (04:35 +0100)]
modutils: add FEATURE_INSMOD_TRY_MMAP option

function                                             old     new   delta
try_to_mmap_module                                     -     121    +121
bb_init_module_24                                   4514    4578     +64
bb_init_module                                       119     173     +54
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 2/0 up/down: 239/0)             Total: 239 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agotar: add support for -o as synonym to --no-same-owner. +5 bytes
Bernhard Reutner-Fischer [Sun, 25 Oct 2009 00:13:32 +0000 (02:13 +0200)]
tar: add support for -o as synonym to --no-same-owner. +5 bytes

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agotar: handle "tar fx TARFILE" etc
Denys Vlasenko [Sat, 24 Oct 2009 23:32:45 +0000 (01:32 +0200)]
tar: handle "tar fx TARFILE" etc

function                                             old     new   delta
tar_main                                             702     751     +49

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agopatch: add Rob's version for reference, it may handle fuzz and offsets
Denys Vlasenko [Sat, 24 Oct 2009 22:39:51 +0000 (00:39 +0200)]
patch: add Rob's version for reference, it may handle fuzz and offsets

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agopatch: add another test (currently fails)
Denys Vlasenko [Sat, 24 Oct 2009 22:35:04 +0000 (00:35 +0200)]
patch: add another test (currently fails)

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agofix up potential printf's with unsafe format strings
Denys Vlasenko [Sat, 24 Oct 2009 15:47:56 +0000 (17:47 +0200)]
fix up potential printf's with unsafe format strings

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agomkfs_ext2: fix compile error
Denys Vlasenko [Sat, 24 Oct 2009 15:20:29 +0000 (17:20 +0200)]
mkfs_ext2: fix compile error

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agopatch: add longopts, --dry-run, add one more test
Denys Vlasenko [Sat, 24 Oct 2009 15:11:55 +0000 (17:11 +0200)]
patch: add longopts, --dry-run, add one more test

function                                             old     new   delta
patch_main                                          1110    1214    +104
static.patch_longopts                                  -      47     +47
packed_usage                                       26738   26761     +23
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 2/0 up/down: 174/0)             Total: 174 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agoftpget/put: make 3rd parameter optional
Vladimir Dronnikov [Fri, 23 Oct 2009 21:34:43 +0000 (23:34 +0200)]
ftpget/put: make 3rd parameter optional

function                                             old     new   delta
packed_usage                                       26728   26738     +10
ftpgetput_main                                       343     351      +8

Signed-off-by: Vladimir Dronnikov <dronnikov@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agoifplugd: fix compile error
Denys Vlasenko [Fri, 23 Oct 2009 16:31:02 +0000 (18:31 +0200)]
ifplugd: fix compile error

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agodate: line up tabs in usage text
Denys Vlasenko [Fri, 23 Oct 2009 14:25:20 +0000 (16:25 +0200)]
date: line up tabs in usage text

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agols: fix "ls | cat" to not show "total NNN" header
Denys Vlasenko [Fri, 23 Oct 2009 14:22:25 +0000 (16:22 +0200)]
ls: fix "ls | cat" to not show "total NNN" header

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agodate: handle long options
Bernhard Reutner-Fischer [Fri, 23 Oct 2009 13:44:51 +0000 (15:44 +0200)]
date: handle long options

RFC2822 obsoletes RFC822; Silently accept --rfc-822 and return rfc2822
output for compatibility.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
15 years agolibbb.h: tidy it up a bit. no code changes (verified)
Denys Vlasenko [Fri, 23 Oct 2009 12:24:44 +0000 (14:24 +0200)]
libbb.h: tidy it up a bit. no code changes (verified)

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agofix isalnum and isxdigit. Unfortunately, +285 bytes
Denys Vlasenko [Fri, 23 Oct 2009 11:57:24 +0000 (13:57 +0200)]
fix isalnum and isxdigit. Unfortunately, +285 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agoeliminate all remaining users of ctype. ~600 byte large tables are gone.
Denys Vlasenko [Fri, 23 Oct 2009 11:05:03 +0000 (13:05 +0200)]
eliminate all remaining users of ctype. ~600 byte large tables are gone.

function                                             old     new   delta
skip_thing                                           253     278     +25
find_range                                           497     508     +11
ask                                                  220     228      +8
...
setlocalenv                                           90      82      -8
bb_strtoll                                            84      76      -8
bb_strtol                                             85      77      -8
is_well_formed_var_name                               75      66      -9
expand                                               651     641     -10
endofname                                            104      92     -12
buffer_fill_and_print                                196     179     -17
isxdigit                                              18       -     -18
httpd_main                                           729     711     -18
__GI_isxdigit                                         18       -     -18
ispunct                                               20       -     -20
isalnum                                               20       -     -20
__GI_ispunct                                          20       -     -20
__GI_isalnum                                          20       -     -20
toupper                                               29       -     -29
tolower                                               29       -     -29
__GI_toupper                                          29       -     -29
__GI_tolower                                          29       -     -29
do_cmd                                              4454    4330    -124
------------------------------------------------------------------------------
(add/remove: 0/12 grow/shrink: 14/29 up/down: 81/-549)       Total: -468 bytes
   text    data     bss     dec     hex filename
 823051     445    7548  831044   cae44 busybox_old
 821970     441    7548  829959   caa07 busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agosmall optimizations of toupper/tolower
Denys Vlasenko [Fri, 23 Oct 2009 11:03:59 +0000 (13:03 +0200)]
small optimizations of toupper/tolower

function                                             old     new   delta
in_ib                                                191     172     -19

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years ago*: optimize most of isXXXXX() macros
Denys Vlasenko [Fri, 23 Oct 2009 01:16:08 +0000 (03:16 +0200)]
*: optimize most of isXXXXX() macros

   text    data     bss     dec     hex filename
 824164     453    6812  831429   cafc5 busybox_old
 823730     453    6812  830995   cae13 busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agolibbb: smaller isdigit. -95 bytes
Denys Vlasenko [Fri, 23 Oct 2009 00:22:03 +0000 (02:22 +0200)]
libbb: smaller isdigit. -95 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agobuild failure fix and some cosmetics
Denys Vlasenko [Thu, 22 Oct 2009 23:30:26 +0000 (01:30 +0200)]
build failure fix and some cosmetics

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years ago*: remove last function calls to isspace
Denys Vlasenko [Thu, 22 Oct 2009 20:28:08 +0000 (22:28 +0200)]
*: remove last function calls to isspace

function                                             old     new   delta
xstrtoul_range_sfx                                   232     231      -1
xstrtoull_range_sfx                                  295     293      -2
trim                                                  82      80      -2
trim_trailing_spaces_and_print                        57      52      -5
isspace                                               18       -     -18

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agonetworking/interface.c: tiny code shrink
Denys Vlasenko [Thu, 22 Oct 2009 17:42:26 +0000 (19:42 +0200)]
networking/interface.c: tiny code shrink

function                                             old     new   delta
if_readlist_proc                                     634     631      -3

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years ago*: use better isspace implementation
Denys Vlasenko [Thu, 22 Oct 2009 17:41:45 +0000 (19:41 +0200)]
*: use better isspace implementation

function                                             old     new   delta
asciifile                                             90     106     +16
expand                                               653     658      +5
skip_non_whitespace                                   21      25      +4
bb_iswspace                                           25      28      +3
readcmd                                             1071    1072      +1
find_range                                           496     497      +1
singlemount                                          772     771      -1
ifupdown_main                                       2134    2133      -1
edir                                                 370     369      -1
volume_id_set_label_string                            82      79      -3
trim                                                  85      82      -3
rtc_adjtime_is_utc                                   141     138      -3
rewrite                                             1039    1036      -3
do_cmd                                              4465    4462      -3
bb_dump_add                                          358     355      -3
awk_split                                            553     550      -3
fbset_main                                          1273    1268      -5
skip_thing                                           259     253      -6
get_trimmed_slice                                     46      39      -7
bb__parsegrent                                       245     238      -7
parse_file_cmd                                       116     108      -8
check                                               1532    1523      -9
bb__pgsreader                                        198     188     -10
dot_skip_over_ws                                      61      46     -15
colon                                               3032    3012     -20
if_readlist_proc                                     655     634     -21
normalize                                            193     165     -28
add_cmd                                             1162    1133     -29
get_key                                              528     476     -52
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 6/23 up/down: 30/-241)         Total: -211 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agomkfs_ext2: code shrink
Denys Vlasenko [Thu, 22 Oct 2009 10:41:44 +0000 (12:41 +0200)]
mkfs_ext2: code shrink

function                                             old     new   delta
mkfs_ext2_main                                      2505    2492     -13

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agomkfs_ext2: fix a bug where we don't fully respect -n on files
Denys Vlasenko [Thu, 22 Oct 2009 10:27:10 +0000 (12:27 +0200)]
mkfs_ext2: fix a bug where we don't fully respect -n on files

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agomke2fs: mention -F in usage text
Denys Vlasenko [Thu, 22 Oct 2009 10:24:48 +0000 (12:24 +0200)]
mke2fs: mention -F in usage text

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agotrimming help text
Denys Vlasenko [Thu, 22 Oct 2009 10:15:33 +0000 (12:15 +0200)]
trimming help text

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agomkfs_ext2: use compatible inode sizes; add -I <inodesize>. (by Vladimir)
Denys Vlasenko [Thu, 22 Oct 2009 10:12:17 +0000 (12:12 +0200)]
mkfs_ext2: use compatible inode sizes; add -I <inodesize>. (by Vladimir)

function                                             old     new   delta
mkfs_ext2_main                                      2385    2495    +110
packed_usage                                       26400   26447     +47
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 157/0)             Total: 157 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agotune2fs: new applet by Vladimir. Only supports -L LABEL
Denys Vlasenko [Wed, 21 Oct 2009 22:55:55 +0000 (00:55 +0200)]
tune2fs: new applet by Vladimir. Only supports -L LABEL

function                                             old     new   delta
tune2fs_main                                           -     165    +165
packed_usage                                       26692   26702     +10
applet_names                                        2148    2156      +8
applet_main                                         1264    1268      +4
applet_nameofs                                       632     634      +2
applet_install_loc                                   158     159      +1
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 5/0 up/down: 190/0)             Total: 190 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agomkfs_ext2: 1.41.9 compat
Denys Vlasenko [Wed, 21 Oct 2009 22:38:52 +0000 (00:38 +0200)]
mkfs_ext2: 1.41.9 compat

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agodf: trivial 64-bit fix
Denys Vlasenko [Wed, 21 Oct 2009 21:28:20 +0000 (23:28 +0200)]
df: trivial 64-bit fix

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agomkfs_ext2: make sure we extend the image to requested size
Denys Vlasenko [Wed, 21 Oct 2009 21:23:55 +0000 (23:23 +0200)]
mkfs_ext2: make sure we extend the image to requested size

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agocosmetics in mkfs_ext2.txt
Denys Vlasenko [Wed, 21 Oct 2009 12:25:21 +0000 (14:25 +0200)]
cosmetics in mkfs_ext2.txt

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agomkfs_ext2_test: disable incomtatible behavior in standard mke2fs
Denys Vlasenko [Wed, 21 Oct 2009 12:14:51 +0000 (14:14 +0200)]
mkfs_ext2_test: disable incomtatible behavior in standard mke2fs

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agomkfs_ext2: e2fsck 1.14.4 compat
Denys Vlasenko [Wed, 21 Oct 2009 12:01:25 +0000 (14:01 +0200)]
mkfs_ext2: e2fsck 1.14.4 compat

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agomkfs_ext2: explain 256-byte inodes. no code changes
Denys Vlasenko [Wed, 21 Oct 2009 09:34:32 +0000 (11:34 +0200)]
mkfs_ext2: explain 256-byte inodes. no code changes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agomkfs_ext2: explain why 0.5G+ images are a bit different
Denys Vlasenko [Tue, 20 Oct 2009 22:34:27 +0000 (00:34 +0200)]
mkfs_ext2: explain why 0.5G+ images are a bit different

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agomkfs_ext2: another update by Vladimir
Denys Vlasenko [Tue, 20 Oct 2009 20:12:11 +0000 (22:12 +0200)]
mkfs_ext2: another update by Vladimir

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agoadd B921600
Bernhard Reutner-Fischer [Tue, 20 Oct 2009 17:40:20 +0000 (19:40 +0200)]
add B921600

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
15 years agoclarify in comment
Denys Vlasenko [Tue, 20 Oct 2009 15:49:50 +0000 (17:49 +0200)]
clarify in comment

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agomkfs_ext2: further work on small images
Denys Vlasenko [Tue, 20 Oct 2009 15:47:23 +0000 (17:47 +0200)]
mkfs_ext2: further work on small images

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agomkfs_ext2: fixes for small image generation. images up to ~8M are ok now
Denys Vlasenko [Tue, 20 Oct 2009 15:04:55 +0000 (17:04 +0200)]
mkfs_ext2: fixes for small image generation. images up to ~8M are ok now

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agomkfs_ext2: fix 60k image creation
Denys Vlasenko [Tue, 20 Oct 2009 14:21:29 +0000 (16:21 +0200)]
mkfs_ext2: fix 60k image creation

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agomkfs_ext2: further work by Vladimir
Denys Vlasenko [Tue, 20 Oct 2009 11:34:16 +0000 (13:34 +0200)]
mkfs_ext2: further work by Vladimir

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agomkfs_ext2: small tweak
Denys Vlasenko [Mon, 19 Oct 2009 22:16:24 +0000 (00:16 +0200)]
mkfs_ext2: small tweak

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agomkfs_ext2: compat fixes
Denys Vlasenko [Mon, 19 Oct 2009 22:06:03 +0000 (00:06 +0200)]
mkfs_ext2: compat fixes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agohush: fix exec builtin in a better way (+ "glob in exec" bug fixed)
Denys Vlasenko [Mon, 19 Oct 2009 21:09:06 +0000 (23:09 +0200)]
hush: fix exec builtin in a better way (+ "glob in exec" bug fixed)

function                                             old     new   delta
execvp_or_die                                          -      50     +50
static.pseudo_null_str                                 3       -      -3
builtin_exec                                          83      57     -26
pseudo_exec_argv                                     200     163     -37
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 0/2 up/down: 50/-66)            Total: -16 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agomenuconfig tweaks
Denys Vlasenko [Mon, 19 Oct 2009 16:56:26 +0000 (18:56 +0200)]
menuconfig tweaks

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agohush: use configured max line length, not BUFSIZE from libc
Denys Vlasenko [Mon, 19 Oct 2009 14:34:39 +0000 (16:34 +0200)]
hush: use configured max line length, not BUFSIZE from libc

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agorandomconfig fixes
Denys Vlasenko [Mon, 19 Oct 2009 14:07:28 +0000 (16:07 +0200)]
randomconfig fixes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agohush: remove superfluous assignment
Denys Vlasenko [Mon, 19 Oct 2009 11:24:07 +0000 (13:24 +0200)]
hush: remove superfluous assignment

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agohush: make it compile again :/
Denys Vlasenko [Mon, 19 Oct 2009 11:20:52 +0000 (13:20 +0200)]
hush: make it compile again :/

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agohush: cosmetics. no code changes
Denys Vlasenko [Mon, 19 Oct 2009 11:13:06 +0000 (13:13 +0200)]
hush: cosmetics. no code changes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agomkfs_ext2: more work. added test script
Denys Vlasenko [Sun, 18 Oct 2009 18:57:52 +0000 (20:57 +0200)]
mkfs_ext2: more work. added test script

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agomkfs_ext2: fixes for huge filesystems
Denys Vlasenko [Sun, 18 Oct 2009 16:05:27 +0000 (18:05 +0200)]
mkfs_ext2: fixes for huge filesystems

function                                             old     new   delta
mkfs_ext2_main                                      2145    2617    +472
div_roundup                                           15      35     +20
packed_usage                                       26792   26776     -16

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agomkfs_ext2: make it able to create images larger than 4G
Denys Vlasenko [Sun, 18 Oct 2009 14:29:30 +0000 (16:29 +0200)]
mkfs_ext2: make it able to create images larger than 4G

function                                             old     new   delta
mkfs_ext2_main                                      1904    2145    +241
has_super                                             29      23      -6
PUT                                                   52      40     -12
packed_usage                                       26807   26792     -15
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/3 up/down: 241/-33)           Total: 208 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agohush: fix handling of empty arguments
Denys Vlasenko [Sun, 18 Oct 2009 09:46:35 +0000 (11:46 +0200)]
hush: fix handling of empty arguments

function                                             old     new   delta
builtin_exec                                          25      83     +58
parse_stream                                        2242    2261     +19
run_pipe                                            1782    1787      +5
static.pseudo_null_str                                 -       3      +3
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 3/0 up/down: 85/0)               Total: 85 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agomkfs_ext2: shrink
Denys Vlasenko [Sun, 18 Oct 2009 07:57:39 +0000 (09:57 +0200)]
mkfs_ext2: shrink

function                                             old     new   delta
mkfs_ext2_main                                      1924    1904     -20

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agohush: handle empty execs
Mike Frysinger [Sun, 18 Oct 2009 05:11:45 +0000 (01:11 -0400)]
hush: handle empty execs

Sometimes variable expansions yield empty strings, and if they happen to
be a command someone wants to run like `$foo`, then hush currently
segfaults.  So handle `` and $().

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
15 years agomkfs_ext2: code shrink
Denys Vlasenko [Sat, 17 Oct 2009 21:47:36 +0000 (23:47 +0200)]
mkfs_ext2: code shrink

function                                             old     new   delta
mkfs_ext2_main                                      1933    1924      -9

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agotrim usage text
Denys Vlasenko [Sat, 17 Oct 2009 21:41:15 +0000 (23:41 +0200)]
trim usage text

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 years agomkfs_ext2: code shrink
Denys Vlasenko [Sat, 17 Oct 2009 21:27:29 +0000 (23:27 +0200)]
mkfs_ext2: code shrink

function                                             old     new   delta
div_roundup                                            -      15     +15
mkfs_ext2_main                                      1980    1933     -47

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