| Commit message (Collapse) | Author | Age | Files | Lines |
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
fg_bgcmd 294 296 +2
killpg 43 - -43
------------------------------------------------------------------------------
(add/remove: 0/2 grow/shrink: 1/0 up/down: 2/-43) Total: -41 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| | |
function old new delta
parse_with_base 174 196 +22
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| | |
Additional support for background jobs was added in commits
010abea6f and 1403d81c4.
The condition ENABLE_PLATFORM_POSIX || JOBS_WIN32 in showjob()
is always true. The conditional compilation can be removed.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This didn't produce the expected output when run from ash:
ash -c "echo abc | sed s/a/x/" <&-
In general, if the last command in the pipe read from stdin the
command didn't work; if it read from file descriptor 0 (e.g. cat)
it did.
Closing a file descriptor caused the corresponding stream to
become invalid. For performance reasons the shell in busybox-w32
runs applets without an exec(), but that results in their seeing
the invalid stream from their parent.
Avoid the problem by calling exec() in such cases. This causes the
child process to get a new stdin stream initialised from the file
descriptor. The test also applies to stdout and stderr. There's
no discernable affect on performance when running the test suite.
Adds 64-96 bytes.
(GitHub issue #558)
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Since commit f7bcc977c (ash: make ctrl-c trap handling closer to
upstream) when ctrl-c was entered at an interactive prompt without
a 'trap INT' in force, '^C' was echoed to the console twice.
Detect this condition and avoid the duplication.
Adds 16 bytes.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
The fact that "environ" is not assignable goes the same for
both 32 and 64 bit ARM on msvcrt - this is not an issue on UCRT
as noted in c44f23f4acbbd854eccd962110e41343d8f03296.
This extends the original workaround from
ea8742bc1657cd0aae32ac555560c8228795488f to 32 bit ARM too.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The command 'read -t 10' couldn't be interrupted by ctrl-c
when ash was running in the mintty terminal emulator.
This issue was introduced by commits 8e6991733 and b2901ce8e
which fixed other problems with the 'read' builtin.
Rearrange the code to avoid calling poll(2) in an interactive
shell on Windows.
(GitHub issue #547)
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
Use the (somewhat ancient) Microsoft RtlGenRandom() function to
provide random data for /dev/urandom.
Saves 176-240 bytes.
(GitHub issue #519)
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
The '^C' displayed on interrupt should go directly to the console
to emulate the typical behaviour of the Unix tty driver.
Adds 16 bytes.
(GitHub issue #531)
|
| | |
| |
| |
| |
| |
| |
| | |
When the wait builtin detects an interrupt it should print '^C' to
stdout, as is done in other similar cases.
Saves 16 bytes in the 64-bit build.
|
| |\| |
|
| | |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Commit 387d01161 (ash: allow wait builtin to be interrupted)
allowed the wait builtin to be interrupted by ctrl-c. However,
this didn't work in the presence of a trap.
When waitpid_child() detects an interrupt propagate this up the
call stack so the wait builtin terminates and the trap is invoked.
Adds 80-88 bytes.
(GitHub issue #530)
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Commit 64c8f5f3d0 (ash: add support for INT trap) didn't follow
upstream behaviour. If a trap is supplied for SIGINT, upstream's
signal handler detects this and doesn't call raise_interrupt().
The busybox-w32 implementation called raise_interrupt() but had it
do nothing.
Modify the code to match upstream's behaviour.
Saves 16-36 bytes.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
After commit f6be217fa (ash: wait builtin should block) it wasn't
possible to interrupt a call to wait with Ctrl-C.
A blocking wait should be stopped from time to time to check for
an interrupt.
Adds 32 bytes.
(GitHub issue #529)
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It was found that the 'wait' shell builtin would use 100% of a core
when waiting for a process to terminate:
sleep 60 &
wait
This is a regression caused by commit bb8f6b688 (ash: fix slow
running when background job is present). See the commit message
and GitHub issue #434 for the long and involved history.
The problem is in the Windows implementation of waitproc() in ash.
The 'block' argument to waitproc() can take three values:
DOWAIT_NONBLOCK
DOWAIT_BLOCK
DOWAIT_CHILD_OR_SIG
The first two have obvious meanings. The third performs a non-
blocking wait(2) and if no PID is returned it waits for SIGCHLD.
So in effect it's a blocking wait.
The Windows implementation would perform a non-blocking wait(2)
but couldn't then wait for SIGCHLD, because Windows doesn't have
such a signal. As a result the 'wait' builtin would loop calling
waitproc().
To avoid this DOWAIT_CHILD_OR_SIG should be treated as a blocking
wait in waitproc().
(GitHub issue #529)
|
| |\| |
|
| | |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
write2pipe - 133 +133
.rodata 105992 106009 +17
readtoken1 3101 3111 +10
cmdtxt 631 641 +10
nodesize 27 28 +1
redirect 961 916 -45
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 4/1 up/down: 171/-45) Total: 126 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |\| |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
parse_stream 3063 3075 +12
done_word 777 784 +7
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 19/0) Total: 19 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
done_word 766 777 +11
static.reserved_match 16 12 -4
reserved_list 240 168 -72
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/2 up/down: 11/-76) Total: -65 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For some reason, it was only happening in interactive use
function old new delta
initialize_context 39 54 +15
parse_stream 3077 3063 -14
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 15/-14) Total: 1 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| | |
function old new delta
done_word 790 766 -24
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
die_if_script 28 34 +6
hush_main 1146 1150 +4
run_list 1031 1028 -3
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/1 up/down: 10/-3) Total: 7 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
reserved_list - 240 +240
parse_stream 2923 3077 +154
done_word 771 790 +19
.rodata 105975 105992 +17
static.reserved_match 12 16 +4
static.reserved_list 168 - -168
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 4/0 up/down: 434/-168) Total: 266 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| | |
function old new delta
parse_stream 2940 2923 -17
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
parse_stream 2857 2940 +83
i_peek 55 69 +14
i_free_alias_buffer 33 37 +4
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/0 up/down: 101/0) Total: 101 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
print_pfx_escaped_nl - 83 +83
builtin_alias 216 218 +2
.rodata 105985 105975 -10
parse_stream 2873 2857 -16
builtin_set 301 259 -42
builtin_readonly 107 59 -48
builtin_export 145 93 -52
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/5 up/down: 85/-168) Total: -83 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
parse_stream 2540 2873 +333
i_getch 85 410 +325
builtin_alias - 216 +216
builtin_unalias - 185 +185
.rodata 105806 105985 +179
word_matches_alias - 82 +82
find_alias_slot - 77 +77
end_of_alias_name - 69 +69
builtin_type 128 179 +51
i_free_alias_buffer - 33 +33
enable_all_aliases - 29 +29
bltins1 396 420 +24
o_reset_to_empty_unquoted - 21 +21
run_pipe 1554 1566 +12
i_peek 57 55 -2
parse_redirect 351 346 -5
redirect_opt_num 63 53 -10
encode_then_append_var_plusminus 552 532 -20
done_word 796 771 -25
i_getch_interactive 308 - -308
------------------------------------------------------------------------------
(add/remove: 8/1 grow/shrink: 6/5 up/down: 1636/-370) Total: 1266 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| | |
function old new delta
set_local_var 416 409 -7
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
setup_heredoc 299 351 +52
parse_stream 2514 2540 +26
parse_redirect 335 351 +16
redir_table 40 48 +8
static.setup_redirects 394 400 +6
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 5/0 up/down: 108/0) Total: 108 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| | |
function old new delta
parse_stream 2513 2514 +1
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Was trying to add code to reject more invalid "case" syntaxes, but it's not that easy
function old new delta
done_word 795 796 +1
parse_stream 2529 2513 -16
.rodata 105825 105806 -19
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/2 up/down: 1/-35) Total: -34 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| | |
While at it, remove now-unused WORD_IS_KEYWORD
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| | |
function old new delta
parse_stream 2566 2524 -42
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| | |
function old new delta
parse_stream 2572 2566 -6
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| | |
function old new delta
parse_stream 2565 2572 +7
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Final link with: <none>
function old new delta
i_getch_interactive - 308 +308
i_getch 102 85 -17
fgetc_interactive 309 - -309
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 0/1 up/down: 308/-326) Total: -18 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
0-9,A-Z,a-z are never special and just go into the current word.
function old new delta
parse_stream 2476 2565 +89
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| | |
No logic changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
parse_stream 2446 2476 +30
done_word 797 800 +3
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 33/0) Total: 33 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Also, deindent "ch == EOF" code branch in parse_stream()
function old new delta
done_word 799 797 -2
parse_stream 2453 2446 -7
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-9) Total: -9 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|