summaryrefslogtreecommitdiff
path: root/shell (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
| * hush: fix raw ^C handlisg in single-quoted stringsDenys Vlasenko2018-01-139-12/+15
| | | | | | | | | | | | | | function old new delta parse_stream 2719 2754 +35 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: add command2.tests from ash testsDenys Vlasenko2018-01-122-0/+8
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: tweak command -vV printing code, no logic changesDenys Vlasenko2018-01-121-3/+5
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: implement "command -v -V"Denys Vlasenko2018-01-121-31/+84
| | | | | | | | | | | | | | | | | | | | | | function old new delta pseudo_exec_argv 231 374 +143 if_command_vV_print_and_exit - 127 +127 builtin_set 267 273 +6 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/0 up/down: 276/0) Total: 276 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: implement "command" builtin (no options are supported yet)Denys Vlasenko2018-01-111-1/+16
| | | | | | | | | | | | | | function old new delta pseudo_exec_argv 194 231 +37 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: fix handling of ^C in evalDenys Vlasenko2018-01-115-4/+36
| | | | | | | | | | | | | | | | | | | | | | function old new delta run_list 1044 1259 +215 builtin_eval 45 126 +81 expand_strvec_to_string 91 - -91 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 2/0 up/down: 296/-91) Total: 205 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: fix handling of raw ^C in scripts: "echo ^C"Denys Vlasenko2018-01-115-4/+27
| | | | | | | | | | | | | | | | function old new delta expand_vars_to_list 1133 1187 +54 parse_stream 2690 2719 +29 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: remove dead codeDenys Vlasenko2018-01-111-15/+0
| | | | | | | | | | | | | | function old new delta done_word 761 711 -50 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: ALWAYS_INLINE grabstackblock()Denys Vlasenko2018-01-101-1/+1
| | | | | | | | | | | | | | function old new delta grabstackblock 5 - -5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: make ${v:N:M} more robust for very large M by clamping to MIN/MAX_INTDenys Vlasenko2018-01-101-13/+25
| | | | | | | | | | | | | | | | | | | | | | Before this patch, "${v:2:0x100000001}" = "${v:2:1}", and similarly, constructs like "${v:2:9999999999}" may give wrong result due to int overflows. function old new delta substr_atoi - 43 +43 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: add comment explaining last changeDenys Vlasenko2018-01-091-6/+6
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: fix var_bash5.tests - ${VAR/pattern/repl} constructDenys Vlasenko2018-01-091-25/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta subevalvar 1198 1279 +81 rmescapes 308 330 +22 preglob 8 10 +2 parsefname 152 154 +2 expandarg 973 975 +2 argstr 1144 1146 +2 mklocal 290 288 -2 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 6/1 up/down: 111/-2) Total: 109 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: fail if 'shift' operand is out of rangeIngo van Lil2018-01-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the numeric argument passed to ash's 'shift' built-in is greater than '$#' the command performs no operation and exits successfully. It should return a non-zero exit code instead: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#shift This is consistent with bash and hush. function old new delta shiftcmd 122 120 -2 Signed-off-by: Ingo van Lil <inguin@gmx.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * randomconfig fixesDenys Vlasenko2017-12-312-6/+9
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-11-0310-25/+179
|\|
| * ash: fix nofork bug where environment is not properly passed to a commandDenys Vlasenko2017-11-035-5/+88
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta listvars 144 252 +108 evalcommand 1500 1546 +46 showvars 142 147 +5 shellexec 242 245 +3 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/0 up/down: 162/0) Total: 162 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: retain envvars with bad names in initial environment. Closes 10231Denys Vlasenko2017-11-021-4/+22
| | | | | | | | | | | | | | Reworks "ash: [VAR] Sanitise environment variable names on entry" commit. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: fix comment parsing in `cmd`, closes 10421Denys Vlasenko2017-10-225-4/+47
| | | | | | | | | | | | | | function old new delta parse_stream 2692 2690 -2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * whitespace fixesDenys Vlasenko2017-10-121-3/+3
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * typo fixDenys Vlasenko2017-10-121-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: survive failures in $PS1 expansion. Closes 10371Denys Vlasenko2017-10-121-1/+18
| | | | | | | | | | | | | | function old new delta expandstr 120 209 +89 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * use %m printf specifier where appropriateDenys Vlasenko2017-09-291-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta out 85 75 -10 udhcpd_main 1472 1461 -11 open_stdio_to_tty 98 85 -13 init_exec 245 232 -13 udhcpc_main 2763 2749 -14 do_cmd 4771 4755 -16 status_line_bold_errno 32 14 -18 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/7 up/down: 0/-95) Total: -95 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-09-279-30/+156
|\|
| * regularize format of source file headers, no code changesDenys Vlasenko2017-09-181-6/+6
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: fix false positive in unset.testsDenys Vlasenko2017-08-291-0/+6
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: GETOPT_RESET() _after_ getopts too.Denys Vlasenko2017-08-292-3/+4
| | | | | | | | | | | | | | | | | | NOEXEC'ed applets which use getopt() need this. function old new delta builtin_getopts 403 413 +10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: reuse "OPTIND=..." stringDenys Vlasenko2017-08-291-1/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: fix "getopts" builtin to not be upset by other builtins calling getopt()Denys Vlasenko2017-08-295-15/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta builtin_getopts 363 403 +40 unset_local_var_len 185 215 +30 set_local_var 440 466 +26 reset_traps_to_defaults 151 157 +6 pseudo_exec_argv 320 326 +6 install_special_sighandlers 52 58 +6 pick_sighandler 62 65 +3 execvp_or_die 85 88 +3 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 8/0 up/down: 120/0) Total: 120 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: more s/error/perror/ for better error reportingDenys Vlasenko2017-08-231-5/+5
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: when cd fails, say whyJohannes Schindelin2017-08-231-1/+1
| | | | | | | | | | Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: report reason when a script file could not be openedJohannes Schindelin2017-08-231-1/+1
| | | | | | | | | | | | | | | | It is always nicer to give the user some sort of indication why an operation failed. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | ash: stop assuming that pointers and ints are interchangeableJohannes Schindelin2017-08-311-3/+3
| | | | | | | | | | | | | | | | This is a companion patch to db169a143 (win32: ash: forkshell_init(), 2010-04-14). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* | ash: avoid assumption about sizeof(long) == sizeof(void *)Johannes Schindelin2017-08-311-1/+1
| | | | | | | | | | | | | | | | This change fixes a minor bug in eea918c5e (win32: ash: spawn_forkshell(), 2010-04-14). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* | win32: shrink code to detect .exe filesRon Yorston2017-08-301-9/+4
| | | | | | | | | | | | | | | | Add a function (has_exe_suffix) to replace explicit code to check if a filename ends with '.exe. or '.com'. Also shrink code that checks for '.exe' or '.com' on PATH in shell's find_command function.
* | Revert "ash: allow long-running nofork applets to be interrupted"Ron Yorston2017-08-221-9/+1
| | | | | | | | | | | | | | This reverts commit f5051d07f196a8ff7aeaae762333d5aa2b824088. Upstream made 'yes' and 'seq' NOEXEC rather than NOFORK which also solves the problem, though NOEXEC doesn't provide any gain in busybox-w32.
* | Merge branch 'busybox' into mergeRon Yorston2017-08-2234-82/+1422
|\|
| * ash: stage backported LINENO support as a separate patchDenys Vlasenko2017-08-171-0/+498
| | | | | | | | | | | | | | | | Looks biggish and not particularly useful, but may be easier to just eat the impact if future backports from dash would be otherwise increasingly difficult. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: trivial code shrink in builtin_getoptsDenys Vlasenko2017-08-171-4/+5
| | | | | | | | | | | | | | function old new delta builtin_getopts 368 363 -5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: unset OPTARG if getopts exits 1, support OPTERR=0 behaviorDenys Vlasenko2017-08-151-2/+11
| | | | | | | | | | | | | | function old new delta getoptscmd 522 547 +25 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash,hush: comment and debug tweaks, no code changesDenys Vlasenko2017-08-152-3/+4
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: one "current line = 1" might be missing, fix thatDenys Vlasenko2017-08-141-4/+5
| | | | | | | | | | | | | | I'm not sure this is necessary, but dash has this init here. Just in case, do it too. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: update testsuite (we now error out on ${#=})Denys Vlasenko2017-08-141-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: [PARSER] Catch variable length expansions on non-existant specialsDenys Vlasenko2017-08-141-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Upstream commit: Date: Thu, 30 Oct 2014 11:53:35 +0800 [PARSER] Catch variable length expansions on non-existant specials Currently we only check special variable names that follow directly after $ or ${. So errors such as ${#&} are not caught. This patch fixes that by moving the is_special check to just before we print out the special variable name. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> function old new delta readtoken1 2630 2635 +5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * shell: tweak getopts tests, no code changesDenys Vlasenko2017-08-136-4/+34
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: implement "silent" optstrings of ":opts"Denys Vlasenko2017-08-115-17/+89
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: add a test which fails due to uclibc bug in getopt()Denys Vlasenko2017-08-114-0/+128
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: fix redirect code (was using uninitialized variables)Denys Vlasenko2017-08-111-2/+4
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * shell: add OPTARG poisoning to getopt_optarg.testsDenys Vlasenko2017-08-113-5/+18
| | | | | | | | | | | | ash fails this! Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: teach getopts to set/unset OPTARGDenys Vlasenko2017-08-116-6/+73
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: getopts builtinDenys Vlasenko2017-08-117-2/+212
| | | | | | | | | | | | | | | | | | | | function old new delta builtin_getopts - 271 +271 bltins1 372 384 +12 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/0 up/down: 283/0) Total: 283 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>