| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
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
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>
|
| |
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
| |
function old new delta
parse_stream 2566 2524 -42
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>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
function old new delta
done_word 776 799 +23
parse_stream 2456 2453 -3
done_pipe 252 242 -10
.rodata 105837 105825 -12
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/3 up/down: 23/-25) Total: -2 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
|
|
|
| |
This is not accepted by bash, we may also disallow this,
but for now, at least do not crash
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
|
|
|
|
|
|
| |
function old new delta
parse_stream 2292 2456 +164
done_pipe 231 252 +21
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 185/0) Total: 185 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
function old new delta
o_addqblock - 131 +131
append_str_maybe_ifs_split 53 100 +47
expand_one_var 1872 1897 +25
encode_then_expand_vararg 380 399 +19
sig_unblock 41 43 +2
sig_block 41 40 -1
sigprocmask_allsigs 33 31 -2
expand_vars_to_list 1080 1077 -3
wait_for_child_or_signal 202 193 -9
o_addQstr 175 42 -133
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 4/5 up/down: 224/-148) Total: 76 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
| |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Upstream commit:
Date: Thu, 28 May 2020 21:31:45 +1000
redir: Retry open64 on EINTR
It is possible for open64 to block on named pipes, and therefore
it can be interrupted by signals and return EINTR. We should only
let it fail with EINTR if real signals are pending (i.e., it should
not fail on SIGCHLD if SIGCHLD has not been trapped).
This patch adds a new helper sh_open to retry the open64 call if
necessary. It also calls sh_error when appropriate.
Fixes: 3800d4934391 ("[JOBS] Fix dowait signal race")
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
fetch_heredocs 477 485 +8
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
| |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
|
|
|
|
|
|
| |
function old new delta
.rodata 105787 105823 +36
fetch_heredocs 461 477 +16
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 52/0) Total: 52 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make the read built-in more compatible with bash:
- Return an exit code of 142 on timeout.
- When the timeout expires before a newline is detected in the
input bash captures the partial input. This behaviour is new
since bash version 4.4. BusyBox shells had the pre-4.4 behaviour
where the input was lost.
Update the tests to suit and fix a couple of compiler errors in
the testsuite.
function old new delta
builtin_read 154 174 +20
readcmd 213 228 +15
shell_builtin_read 1364 1370 +6
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/0 up/down: 41/0) Total: 41 bytes
Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
$ echo >&99
hush: dup2(99,1): Bad file descriptor
$ echo >&9999
hush: fcntl(1,F_DUPFD,10000): Invalid argument
$ echo 2>/dev/tty 10>&9999
hush: fcntl(10,F_DUPFD,10000): Invalid argument
$ still alive!_
function old new delta
static.setup_redirects 334 394 +60
.rodata 105661 105712 +51
dup_CLOEXEC 49 79 +30
save_fd_on_redirect 263 277 +14
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/0 up/down: 155/0) Total: 155 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
| |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
|
|
|
| |
function old new delta
subevalvar 1576 1588 +12
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
|
|
|
|
|
|
| |
function old new delta
parse_stream 2271 2292 +21
.rodata 105408 105427 +19
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 40/0) Total: 40 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
|
|
|
|
|
|
| |
function old new delta
.rodata 105304 105261 -43
parse_command 1696 1633 -63
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-106) Total: -106 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
|
|
|
|
|
|
| |
function old new delta
parse_with_base - 170 +170
evaluate_string 1477 1309 -168
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/1 up/down: 170/-168) Total: 2 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
| |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes ash-arith-arith-ternary1/2.tests
function old new delta
evaluate_string 1271 1432 +161
arith_apply 968 1000 +32
arith 22 36 +14
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/0 up/down: 207/0) Total: 207 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes arith-assign-in-varexp1.tests
function old new delta
evaluate_string 1132 1258 +126
arith_lookup_val 143 - -143
arith_apply 1132 977 -155
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/1 up/down: 126/-298) Total: -172 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
The "hack" to virtually parenthesize ? EXPR : made this unnecessary.
The expression is effectively a?(b?(c):d):e and thus b?c:d is evaluated
before continuing with the second :
function old new delta
evaluate_string 1148 1132 -16
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes arith-precedence1.tests.
This breaks arith-ternary2.tests again (we now evaluate variables
on not-taken branches). We need a better logic here anyway:
not only bare variables should not evaluate when not-taken:
1 ? eval_me : do_not_eval
but any (arbitrarily complex) expressions shouldn't
evaluate as well!
1 ? var_is_set=1 : ((var_is_not_set=2,var2*=4))
function old new delta
evaluate_string 1097 1148 +51
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
| |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
|
|
|
| |
function old new delta
arith_apply 1134 1143 +9
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
|
|
|
| |
function old new delta
encode_then_append_var_plusminus 554 552 -2
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
|
|
|
| |
function old new delta
run_list 1012 1024 +12
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
|
|
|
| |
function old new delta
builtin_set 258 301 +43
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Patch by Alex Gorinson <algore3698@gmail.com>
function old new delta
evalvar 477 495 +18
varvalue 603 618 +15
subevalvar 1557 1572 +15
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/0 up/down: 48/0) Total: 48 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Without this patch, BusyBox handles bash pattern substitutions without
a terminating '/' character incorrectly.
Consider the following shell script:
_bootstrapver=5.0.211-r0
_referencesdir="/usr/${_bootstrapver/-*}/Sources"
echo $_referencesdir
This should output `/usr/5.0.211/Sources`. However, without this patch
it instead outputs `/usr/5.0.211Sources`. This is due to the fact that
BusyBox expects the bash pattern substitutions to always be terminated
with a '/' (at least in this part of subvareval) and thus reads passed
the substitution itself and consumes the '/' character which is part of
the literal string. If there is no '/' after the substitution then
BusyBox might perform an out-of-bounds read under certain circumstances.
When replacing the bash pattern substitution with `${_bootstrapver/-*/}`,
or with this patch applied, ash outputs the correct value.
Signed-off-by: Sören Tempel <soeren@soeren-tempel.net>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
|
|
|
|
|
|
| |
function old new delta
re_execed_comm - 46 +46
main 72 86 +14
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/0 up/down: 60/0) Total: 60 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
|
|
|
| |
function old new delta
evaluate_string 988 1011 +23
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
| |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
|
|
|
| |
function old new delta
evaluate_string 945 988 +43
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
|
|
| |
The var_LINENO3.tests fails for hush: it does start from 0, but does not increment.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
From larger patch by Roberto A. Foglietta <roberto.foglietta@gmail.com>
function old new delta
evalfun 348 369 +21
ash_main 1202 1218 +16
setinputstring 65 73 +8
lookupvar 116 106 -10
evaltree 772 753 -19
evalsubshell 192 173 -19
evalfor 175 156 -19
evalcase 273 254 -19
evalcommand 1560 1536 -24
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/6 up/down: 45/-110) Total: -65 bytes
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_dollar_squote - 441 +441
encode_then_expand_vararg 359 380 +21
parse_stream 2252 2271 +19
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 2/0 up/down: 481/0) Total: 481 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
| |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Entering "${1a}" into interactive shell was making it exit.
function old new delta
parse_dollar 824 958 +134
i_getch_and_eat_bkslash_nl - 44 +44
parse_expr 917 938 +21
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 2/0 up/down: 199/0) Total: 199 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
|
|
|
|
|
|
| |
function old new delta
parse_stream 2238 2252 +14
encode_string 243 256 +13
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 27/0) Total: 27 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
|
|
| |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|