Denys Vlasenko
6bdfbc4cb5
libbb: fix '--help' handling in FEATURE_SH_NOFORK=y
...
Most BusyBox applets respond to the '--help' option by printing
a usage message. This is normally handled by busybox_main() so
applet main routines don't have support for '--help'.
In standalone shell mode with FEATURE_SH_NOFORK enabled nofork
applets are invoked directly, bypassing busybox_main(). This
results in inconsistent handling of '--help':
- applets which call getopt() report "unrecognized option '--help'"
and print help anyway;
- realpath says "--help: No such file or directory" and doesn't
print help;
- usleep says "invalid number '--help'" and doesn't print help.
Avoid inconsistency by checking for '--help' in run_nofork_applet().
Bug found by Ron Yorston.
function old new delta
show_usage_if_dash_dash_help - 70 +70
run_nofork_applet 347 362 +15
run_applet_no_and_exit 432 365 -67
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/1 up/down: 85/-67) Total: 18 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2021-02-18 23:30:24 +01:00
Denys Vlasenko
33745b1fc8
ash: placate -Werror=format-security
...
"In function 'sprint_status48':
error: format not a string literal and no format arguments"
function old new delta
sprint_status48 160 158 -2
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2021-02-18 13:45:49 +01:00
Denys Vlasenko
666a9a4c4d
applets/usage_pod.c: placate gcc
...
"error: format not a string literal and no format arguments"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2021-02-15 12:36:44 +01:00
Denys Vlasenko
f3a55b306e
traceroute: fix option parsing
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2021-02-02 13:48:21 +01:00
Denys Vlasenko
2b7c1aa92c
ash: match bash behavior for ${empty_var/*/repl}
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2021-01-09 08:46:54 +01:00
Denys Vlasenko
883cdb79a4
ash: fix ${unset_var/pattern/repl}
...
function old new delta
subevalvar 1349 1353 +4
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2021-01-09 08:27:37 +01:00
Denys Vlasenko
cc4303f5e6
bc: code shrink
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2021-01-06 14:00:53 +01:00
Denys Vlasenko
2266c12a79
pmap: fix column width, closes 13431
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2021-01-05 19:39:34 +01:00
Denys Vlasenko
0197fbffb7
bc: ^C on input line exits (unlike ^C during calculations, which does not)
...
function old new delta
xc_read_line 353 344 -9
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2021-01-04 14:41:20 +01:00
Denys Vlasenko
4e039bab37
ash: improve --help
...
function old new delta
packed_usage 33504 33499 -5
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2021-01-04 03:50:38 +01:00
Denys Vlasenko
3b053051c7
hush: code shrink
...
function old new delta
hush_main 1071 1066 -5
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-5) Total: -5 bytes
text data bss dec hex filename
1020110 559 5020 1025689 fa699 busybox_old
1020037 559 5020 1025616 fa650 busybox_unstripped
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2021-01-04 03:05:34 +01:00
Denys Vlasenko
8b085d60bc
nuke: default to N
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2021-01-03 16:48:53 +01:00
Denys Vlasenko
85158b600d
ash: code shrink
...
function old new delta
ash_main 1218 1202 -16
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2021-01-03 12:14:58 +01:00
Denys Vlasenko
3f8ec00b0c
ash: make a strdup copy of $HISTFILE for line editing
...
Otherwise if $HISTFILE is unset or reassigned, bad things can happen.
function old new delta
ash_main 1210 1218 +8
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2021-01-03 10:55:39 +01:00
Denys Vlasenko
868f383699
tls: code shrink
...
function old new delta
curve25519 881 832 -49
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2021-01-01 18:48:38 +01:00
Denys Vlasenko
9daa877d6b
tar: add TODO about a bug with non-writable directories on extract
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2021-01-01 13:34:25 +01:00
Denys Vlasenko
49fd1d69ba
nslookup: do not print "No answer" for NODATA replies, closes 13006
...
Only print when there was no answer at all.
function old new delta
send_queries 1834 1813 -21
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-31 01:39:44 +01:00
Denys Vlasenko
3c13da3dab
libbb: introduce and use xgettimeofday(), do not truncate 64-bit time_t in shells
...
function old new delta
xgettimeofday - 11 +11
get_local_var_value 280 281 +1
svlogd_main 1323 1322 -1
change_epoch 67 66 -1
timestamp_and_log 461 458 -3
hwclock_main 301 298 -3
fmt_time_bernstein_25 135 132 -3
step_time 331 326 -5
script_main 1207 1202 -5
machtime 34 28 -6
curtime 61 54 -7
ts_main 423 415 -8
nmeter_main 761 751 -10
gettime1900d 67 46 -21
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/12 up/down: 12/-73) Total: -61 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-30 23:48:01 +01:00
Denys Vlasenko
89a55972fd
libbb/procps: smaller global data for username/groupname cache
...
function old new delta
get_cached 101 133 +32
cache_user_group - 4 +4
get_cached_username 17 14 -3
username 8 - -8
groupname 8 - -8
clear_username_cache 65 47 -18
------------------------------------------------------------------------------
(add/remove: 1/2 grow/shrink: 1/2 up/down: 36/-37) Total: -1 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-30 01:04:56 +01:00
Denys Vlasenko
b230ff9d8f
*: use fopen helpers where appropriate
...
function old new delta
finalize 348 343 -5
parse_resolvconf 306 299 -7
list_i2c_busses_and_exit 495 483 -12
bootchartd_main 1091 1076 -15
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/4 up/down: 0/-39) Total: -39 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-30 00:16:27 +01:00
Denys Vlasenko
29a9043b36
bc,dc: make BC_LINE_LENGTH/DC_LINE_LENGTH more compatible with GNU
...
function old new delta
xc_vm_init 640 682 +42
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-29 18:52:19 +01:00
Denys Vlasenko
cba45d9b65
Start 1.34.0 development cycle
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-29 17:43:40 +01:00
Denys Vlasenko
a4c3a34139
Bump version to 1.33.0
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-29 17:42:59 +01:00
Denys Vlasenko
ec9a5e6083
libiproute: band-aid for old uclibc missing IFA_FLAGS
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-29 17:34:34 +01:00
Denys Vlasenko
fecb1693cc
modprobe-small: convert to new recursive_action() API
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-29 17:02:06 +01:00
Denys Vlasenko
40f9fe2160
bc: placate gcc (it thinks 's' can be uninitialized here)
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-29 17:02:06 +01:00
Denys Vlasenko
77a51a2709
randomconfig fixes
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-29 16:53:11 +01:00
Denys Vlasenko
c7ef818768
hush: make comment more clear
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-27 16:04:54 +01:00
Denys Vlasenko
1462673dde
man: implement SECTION parameters
...
function old new delta
man_main 807 942 +135
is_section_name - 52 +52
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/0 up/down: 187/0) Total: 187 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-27 16:02:37 +01:00
Denys Vlasenko
cad20ced86
typo fix
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-25 19:08:16 +01:00
Denys Vlasenko
1237d627e9
hush: fix this case: echo "SCRIPT" | hush
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-25 19:01:49 +01:00
Denys Vlasenko
46a71dc30c
hush: if !EDITING, do not regenerate prompt for every input char
...
function old new delta
fgetc_interactive 261 258 -3
pseudo_exec_argv 406 399 -7
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-10) Total: -10 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-25 18:49:29 +01:00
Denys Vlasenko
51a471d05d
ash: change "clear ungetc counter on syntax errors" fix to match dash
...
function old new delta
ash_main 1203 1210 +7
raise_exception 39 26 -13
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 7/-13) Total: -6 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-24 00:22:24 +01:00
Denys Vlasenko
521220ed1a
hush: fix ^C in INTERACTIVE, !EDITING config
...
function old new delta
refill_HFILE_and_getc 88 170 +82
fgetc_interactive 226 250 +24
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 106/0) Total: 106 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-23 23:44:55 +01:00
Denys Vlasenko
18bcaf374c
hush: revert "make interactive ^C break out of PS2 mode"
...
It made ^C break out of the entire shell, if we aren't in PS2 mode.
Need a better idea.
function old new delta
expand_one_var 2344 2353 +9
syntax_error_unterm_ch 21 29 +8
parse_dollar 817 824 +7
parse_stream 2251 2238 -13
fgetc_interactive 249 227 -22
syntax_error_unterm_str 26 - -26
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 3/2 up/down: 24/-61) Total: -37 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-23 23:01:18 +01:00
Denys Vlasenko
649acb9e23
hush: fix PS1 prompth in !EDITING config
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-23 15:29:13 +01:00
Denys Vlasenko
a7b52d26c4
hush: fix fallout from tweaking ${var:START:LEN} code
...
function old new delta
expand_one_var 2344 2353 +9
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-23 12:38:03 +01:00
Denys Vlasenko
93e2a22482
shell: for signal exitcode, use 128 | sig, not 128 + sig - MIPS has signal 128
...
function old new delta
wait_for_child_or_signal 213 214 +1
refill_HFILE_and_getc 89 88 -1
getstatus 97 96 -1
builtin_wait 339 337 -2
checkjobs 187 183 -4
process_wait_result 450 444 -6
waitcmd 290 281 -9
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/6 up/down: 1/-23) Total: -22 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-23 12:23:21 +01:00
Denys Vlasenko
0ab2dd4f28
hush: fix comment
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-23 02:22:08 +01:00
Denys Vlasenko
6297d66eda
factor: fix comment
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-23 02:03:04 +01:00
Denys Vlasenko
6452c30036
factor: detect squares
...
If we have a square, the speedup can be extremely large
(in best case example below, it's ~40000 times faster):
$ time ./busybox_old factor 18446743988964486098
18446743988964486098: 2 3037000493 3037000493
real 0m4.246s
$ time ./busybox factor 18446743988964486098
18446743988964486098: 2 3037000493 3037000493
real 0m0.000s
function old new delta
isqrt_odd - 57 +57
print_w - 36 +36
factorize 218 236 +18
print_h - 7 +7
factorize_numstr 65 72 +7
------------------------------------------------------------------------------
(add/remove: 3/0 grow/shrink: 2/0 up/down: 125/0) Total: 125 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-22 20:24:30 +01:00
Denys Vlasenko
96717d9fb4
lineedit: code shrink
...
function old new delta
read_line_input 3171 3157 -14
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-21 22:50:23 +01:00
Denys Vlasenko
fae7332ebf
lineedit: add a comment about possible use of tcflush()
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-21 21:55:03 +01:00
Denys Vlasenko
00eb23b47a
bc: do not allocate line editing state until needed
...
function old new delta
xc_read_line 324 353 +29
free_line_input_t 34 39 +5
xc_vm_init 656 640 -16
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/1 up/down: 34/-16) Total: 18 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-21 21:36:58 +01:00
Denys Vlasenko
07abc7c6f7
hush: deal with FIXMEs for corner cases in parameter expansion
...
function old new delta
expand_one_var 2323 2344 +21
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-21 10:14:18 +01:00
Denys Vlasenko
901d2c3862
factor: fix typo in undef
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-21 07:45:08 +01:00
Denys Vlasenko
3e544d6ec7
factor: code shrink
...
function old new delta
factor_main 176 171 -5
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-21 07:22:55 +01:00
Denys Vlasenko
f079f91371
factor: 30% faster trial division (better sieve)
...
function old new delta
packed_wheel - 192 +192
factor_main 108 176 +68
factorize 284 218 -66
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/1 up/down: 260/-66) Total: 194 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-20 21:37:29 +01:00
Denys Vlasenko
bb4e32befa
hush: remove one redundant getpid() on every startup
...
function old new delta
hush_main 1151 1147 -4
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-20 16:36:00 +01:00
Denys Vlasenko
c8f6c1d775
ping6: add -w/-W NUM to --help
...
function old new delta
packed_usage 33515 33533 +18
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-20 11:25:50 +01:00
Denys Vlasenko
bc2c1b4f86
ping: fix -wN to not think that one packet is always lost
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-20 11:16:32 +01:00
Denys Vlasenko
2124c0ec97
ash: clear ungetc counter on syntax errors
...
function old new delta
raise_exception 26 39 +13
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-19 14:33:02 +01:00
Denys Vlasenko
4152b41183
tftp: fix --help
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-19 00:33:06 +01:00
Denys Vlasenko
ddc6dfdb4d
route: code shrink
...
function old new delta
kw_lookup 84 86 +2
tbl_hash_net_host 15 14 -1
tbl_verb 21 19 -2
tbl_ipvx 104 92 -12
packed_usage 33527 33493 -34
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/4 up/down: 2/-49) Total: -47 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-19 00:07:13 +01:00
Denys Vlasenko
b164cdb854
help text tweaks, mainly expanding one for route
...
function old new delta
packed_usage 33485 33527 +42
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-18 23:33:19 +01:00
Denys Vlasenko
8cc3a744fb
help text: use -P PORT form
...
function old new delta
packed_usage 33502 33491 -11
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-18 22:51:46 +01:00
Denys Vlasenko
a2f18d950a
help text tweaks
...
function old new delta
packed_usage 33570 33502 -68
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-18 04:12:51 +01:00
Denys Vlasenko
15733cb48e
mount: if we race with other loop mount, we forget to close loop dev
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-17 23:38:06 +01:00
Denys Vlasenko
251e08ffa6
move ADJTIME_PATH define to header files
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-17 20:53:43 +01:00
Denys Vlasenko
a4c5cb2335
traceroute: fix --help text
...
function old new delta
traceroute_init 1151 1153 +2
packed_usage 33568 33570 +2
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 4/0) Total: 4 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-17 18:17:03 +01:00
Denys Vlasenko
ff4ca18501
traceroute: avoid collecting target local address if !VERBOSE
...
function old new delta
common_traceroute_main 1542 1537 -5
traceroute_init 1151 1101 -50
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-55) Total: -55 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-17 17:47:49 +01:00
Denys Vlasenko
4bc59a4cf7
mount: fix a race when a free loop device is snatched under us by another mount.
...
function old new delta
set_loop 850 809 -41
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-17 15:05:14 +01:00
Denys Vlasenko
cd48f07117
mail: launch_helper(): flush stdio before vfork, set G.helper_pid only in parent
...
function old new delta
launch_helper 188 193 +5
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-17 12:55:22 +01:00
Denys Vlasenko
b0e7cb4c3f
mail: deobfuscate launch_helper()
...
13 bytes are not worth the risk of doing something iffy after vfork().
Let's have much clearer code there.
function old new delta
launch_helper 175 188 +13
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-17 12:51:58 +01:00
Denys Vlasenko
b6237c0657
mail: commonalize send_r_n()
...
function old new delta
send_mail_command 85 55 -30
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-17 12:34:25 +01:00
Denys Vlasenko
25b2680056
mail: move "opts" from globals
...
function old new delta
popmaildir_main 812 823 +11
sendmail_main 1295 1301 +6
makemime_main 291 288 -3
parse 970 966 -4
reformime_main 107 100 -7
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/3 up/down: 17/-14) Total: 3 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-17 12:24:50 +01:00
Denys Vlasenko
91e330a53f
shells: a fix for systems without RLIMIT_NICE
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-17 12:07:54 +01:00
Denys Vlasenko
0723131628
Fixes for Hurd build
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-17 11:22:44 +01:00
Denys Vlasenko
bb15969333
libbb: do not compile selinux_or_die() if !SELINUX
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-16 23:00:51 +01:00
Denys Vlasenko
39646dce32
build system: make -static-libgcc selectable in config
...
OpenWrt wants this off.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-16 21:53:05 +01:00
Denys Vlasenko
eb0c2e218c
libbb: introduce and use xsettimeofday()
...
function old new delta
xsettimeofday - 25 +25
rdate_main 274 260 -14
step_time 348 331 -17
set_kernel_timezone_and_clock 119 102 -17
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/3 up/down: 25/-48) Total: -23 bytes
text data bss dec hex filename
1020753 559 5052 1026364 fa93c busybox_old
1020708 559 5052 1026319 fa90f busybox_unstripped
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-16 21:36:36 +01:00
Denys Vlasenko
d3c36882dc
hwclock: improve --help (-l is a compatible shortcut for --localtime)
...
function old new delta
packed_usage 33605 33568 -37
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-16 20:55:30 +01:00
Denys Vlasenko
9e262f13c2
hwclock: fix musl breakage of settimeofday(tz)
...
function old new delta
set_kernel_timezone_and_clock - 119 +119
set_kernel_tz - 28 +28
hwclock_main 480 301 -179
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 0/1 up/down: 147/-179) Total: -32 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-16 14:00:47 +01:00
Denys Vlasenko
a97a795dcb
lineedit: disable completion and fancy prompts if no shells are selected
...
function old new delta
get_previous_history 51 56 +5
get_next_history 47 52 +5
null_str 1 - -1
beep 10 - -10
bb_msg_unknown 10 - -10
bb_internal_setpwent 24 - -24
remove_chunk 30 - -30
goto_new_line 33 - -33
bb_internal_endpwent 36 - -36
deinit_S 51 - -51
free_tab_completion_data 54 - -54
read_line_input 3171 3114 -57
rewind 68 - -68
add_match 70 - -70
complete_username 77 - -77
quote_special_chars 78 - -78
build_match_prefix 557 - -557
complete_cmd_dir_file 697 - -697
parse_and_put_prompt 823 53 -770
input_tab 926 - -926
------------------------------------------------------------------------------
(add/remove: 0/17 grow/shrink: 2/2 up/down: 10/-3549) Total: -3539 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-16 11:14:08 +01:00
Denys Vlasenko
1d180cd749
lineedit: use strncmp instead of is_prefixed_with (we know the length)
...
Also: add comments, rename some variables
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-16 11:00:20 +01:00
Denys Vlasenko
eaced1ec85
lineedit: remove ->path_lookup if ash is not configured
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-16 10:01:21 +01:00
Denys Vlasenko
caba1a16ec
tweak help texts
...
function old new delta
packed_usage 33650 33605 -45
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-16 01:19:08 +01:00
Denys Vlasenko
9b44deac01
ntpd: allow non-root to run it (e.g. with -w option)
...
This is safe: it's not a setuid applet, the attempt to set time
will simply fail if attempted by non-root
From openwrt 600-allow-ntpd-non-root.patch
function old new delta
ntp_init 1049 1005 -44
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-15 23:23:44 +01:00
Denys Vlasenko
73d93d9f83
libbb: make pw_encrypt() die if supplied salt is bad (e.g. emply)
...
Fished from 520-loginutils-handle-crypt-failures.patch in openwrt
function old new delta
pw_encrypt 913 927 +14
des_crypt 1327 1318 -9
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 14/-9) Total: 5 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-15 23:19:22 +01:00
Denys Vlasenko
f3d6711c97
udhcpc6: code shrink - sending functions do not need ifindex parameter
...
function old new delta
d6_send_raw_packet_from_client_data_ifindex - 427 +427
d6_send_kernel_packet_from_client_data_ifindex - 275 +275
send_d6_renew 182 176 -6
perform_d6_release 246 240 -6
d6_mcast_from_client_data_ifindex 45 39 -6
d6_send_kernel_packet 274 - -274
d6_send_raw_packet 429 - -429
------------------------------------------------------------------------------
(add/remove: 2/2 grow/shrink: 0/3 up/down: 702/-721) Total: -19 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-15 21:55:15 +01:00
Denys Vlasenko
01004f9796
libbb: enable fixed 4k pagesize for 32bit ARM
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-15 21:24:04 +01:00
Denys Vlasenko
4a9ec95565
tls: code shrink in AES code
...
function old new delta
aes_cbc_decrypt 862 847 -15
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-15 18:47:25 +01:00
Denys Vlasenko
fad8d6b6c0
build system: combat gcc zealotry in data alignment, now for x86_64 too
...
function old new delta
.rodata 182928 182620 -308
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-15 18:39:05 +01:00
Denys Vlasenko
2aaacc1453
dd: support for O_DIRECT i/o
...
Based on patch by Akash Hadke <hadkeakash4@gmail.com >
function old new delta
dd_read - 66 +66
clear_O_DIRECT - 55 +55
write_and_stats 102 135 +33
dd_main 1578 1601 +23
static.oflag_words 19 26 +7
static.iflag_words 22 29 +7
packed_usage 33665 33668 +3
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 5/0 up/down: 194/0) Total: 194 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-14 20:27:57 +01:00
Denys Vlasenko
c7b858ff8d
libbb: add and use infrastructure for fixed page size optimization
...
function old new delta
procps_scan 1121 1118 -3
getpagesize 6 - -6
rpm_main 1037 1027 -10
rpm2cpio_main 120 110 -10
ptok 38 21 -17
time_main 1282 1261 -21
mkswap_main 317 278 -39
------------------------------------------------------------------------------
(add/remove: 0/2 grow/shrink: 0/6 up/down: 0/-106) Total: -106 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-14 18:54:30 +01:00
Denys Vlasenko
fd3c512f88
libbb: create and use mmap() helpers
...
function old new delta
mmap_anon - 22 +22
mmap_read - 21 +21
xmmap_anon - 16 +16
rpm_gettags 465 447 -18
bb_full_fd_action 498 480 -18
uevent_main 337 310 -27
------------------------------------------------------------------------------
(add/remove: 3/0 grow/shrink: 0/3 up/down: 59/-63) Total: -4 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-14 18:25:28 +01:00
Denys Vlasenko
db793480cb
build system: combat gcc zealotry in data alignment
...
text data bss dec hex filename
1020934 559 5052 1026545 fa9f1 busybox_old
1020750 559 5052 1026361 fa939 busybox_unstripped
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-14 05:53:45 +01:00
Denys Vlasenko
a8e19608fc
hush: code shrink
...
function old new delta
run_applet_main - 20 +20
builtin_kill 296 288 -8
builtin_test 19 10 -9
builtin_printf 19 10 -9
builtin_echo 19 10 -9
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/4 up/down: 20/-35) Total: -15 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-14 03:52:54 +01:00
Denys Vlasenko
84d5eddb25
help text: replace [OPTIONS] with actual options (if not too long)
...
function old new delta
packed_usage 33620 33665 +45
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-13 22:34:05 +01:00
Denys Vlasenko
63139b531f
hush: if login shell, also source ~/.profile
...
function old new delta
hush_main 1101 1151 +50
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-13 22:00:56 +01:00
Denys Vlasenko
1b367cbeda
examples: remove /sbin/ prefixes, system should be configured with $PATH to find utilities
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-13 21:35:26 +01:00
Denys Vlasenko
5d553bc558
more --help text tweaks
...
function old new delta
packed_usage 33545 33581 +36
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-13 19:18:28 +01:00
Denys Vlasenko
11f1a2553e
help text tweaks
...
function old new delta
packed_usage 33547 33545 -2
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-13 19:04:19 +01:00
Denys Vlasenko
49142d48bd
hush: NOMMU fix for hush-psubst/tick6.tests
...
function old new delta
hush_main 1759 1766 +7
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-13 18:44:07 +01:00
Denys Vlasenko
9cabd17e55
hush: fix -c SCRIPT handling
...
function old new delta
hush_main 1763 1759 -4
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-13 18:24:11 +01:00
Denys Vlasenko
31df5a3eee
ash: reset SIGHUP earlier: allows HUP traps in .profile, closes 13371
...
function old new delta
ash_main 1188 1203 +15
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-13 16:36:28 +01:00
Denys Vlasenko
6c5f4296dc
traceroute: code shrink
...
function old new delta
hexdump_if_verbose - 255 +255
common_traceroute_main 1668 1644 -24
hexdump 239 - -239
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 0/1 up/down: 255/-263) Total: -8 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-13 15:58:47 +01:00
Denys Vlasenko
623e55a396
traceroute: even with -v, don't show other ping processes reply's
...
function old new delta
traceroute_init 1135 1151 +16
common_ping_main 1919 1935 +16
common_traceroute_main 1715 1668 -47
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/1 up/down: 32/-47) Total: -15 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-13 15:53:06 +01:00
Denys Vlasenko
d067acb005
traceroute: simpler hexdump()
...
function old new delta
hexdump 270 239 -31
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-13 15:10:07 +01:00
Denys Vlasenko
b4b1828076
traceroute: make "ipv4 or ipv6?" cheaper to find out
...
function old new delta
traceroute_init 1131 1135 +4
hexdump 274 270 -4
common_traceroute_main 1730 1715 -15
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/2 up/down: 4/-19) Total: -15 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2020-12-13 14:58:11 +01:00