aboutsummaryrefslogtreecommitdiff
path: root/shell/hush.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* hush: make read builtin interruptible.Denys Vlasenko2011-05-081-2/+96
| | | | | | | | | | | | | | | function old new delta builtin_read 185 471 +286 check_and_run_traps 200 262 +62 nonblock_immune_read 73 119 +46 sigismember - 44 +44 record_signal - 21 +21 sigisemptyset - 16 +16 ... ------------------------------------------------------------------------------ (add/remove: 5/0 grow/shrink: 7/5 up/down: 483/-46) Total: 437 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix incorrect PS2 dispaly and trap handling while reading commandDenys Vlasenko2011-05-081-5/+22
| | | | | | The fix affects only !ENABLE_FEATURE_EDITING configuration Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash,hush: optional support for $HISTFILESIZE.Denys Vlasenko2011-03-311-0/+4
| | | | | | | | | | | | | Based on patch from Alexey Fomenko (ext-alexey.fomenko AT nokia.com) function old new delta size_from_HISTFILESIZE - 44 +44 hush_main 998 1025 +27 ash_main 1348 1374 +26 read_line_input 3361 3372 +11 new_line_input_t 17 24 +7 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: remove outdated commentsDenys Vlasenko2011-03-301-5/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix source1.testsDenys Vlasenko2011-03-301-27/+37
| | | | | | | | | | | | | function old new delta parse_and_run_stream 95 139 +44 static_get 22 25 +3 file_get 260 263 +3 builtin_umask 133 132 -1 parse_stream 2442 2425 -17 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/2 up/down: 50/-18) Total: 32 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: make parse errors in sourced file non-fatal in interactive scriptDenys Vlasenko2011-03-241-45/+52
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix a case where return in sourced file has no effectDenys Vlasenko2011-03-241-0/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash,hush: recheck LANG before every line inputDenys Vlasenko2011-03-231-9/+16
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash/hush: shrink help textDenys Vlasenko2011-03-081-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash/hush: provide help textDenys Vlasenko2011-03-071-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | $ ./busybox ash --help BusyBox v1.19.0.git (2011-03-07 11:25:29 CET) multi-call binary. Usage: ash [-/+OPTCHARS] [-/+o OPTNAME]... [-c 'SCRIPT' [ARG0 [ARGS]] / SCRIPT_FILE [ARGS]] Unix shell interpreter $ ./busybox hush --help BusyBox v1.19.0.git (2011-03-07 11:25:29 CET) multi-call binary. Usage: hush [-nx] [-c 'SCRIPT' [ARG0 [ARGS]] / SCRIPT_FILE [ARGS]] Unix shell interpreter function old new delta packed_usage 28163 28212 +49 setcmd 85 78 -7 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 49/-7) Total: 42 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: do not print killer signal's name for SIGPIPEDenys Vlasenko2011-02-141-2/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: fix TMOUT not restoring tty attributesDenys Vlasenko2011-02-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | function old new delta pgetc 420 500 +80 readtoken1 3202 3239 +37 read_line_input 3316 3337 +21 udhcpc_main 2610 2630 +20 file_get 266 272 +6 expandarg 958 963 +5 localcmd 257 259 +2 addLines 85 87 +2 read_line 94 95 +1 ed_main 2540 2541 +1 timed_out 1 - -1 lineedit_read_key 256 255 -1 alrm_sighandler 44 - -44 cmdloop 539 434 -105 ------------------------------------------------------------------------------ (add/remove: 0/2 grow/shrink: 10/2 up/down: 175/-151) Total: 24 bytes text data bss dec hex filename 887379 936 17200 905515 dd12b busybox_old 887411 936 17192 905539 dd143 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* echo: do not retry on write errorsDenys Vlasenko2011-02-071-1/+7
| | | | | | | | | | | | | function old new delta echo_main 297 336 +39 stpcpy - 22 +22 run_pipe 1561 1566 +5 pseudo_exec_argv 187 192 +5 hush_exit 75 80 +5 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 4/0 up/down: 98/0) Total: 76 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: use FEATURE_SH_NOFORK to enable NOFORK trickDenys Vlasenko2011-02-021-6/+5
| | | | | | Also expands docs Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: improve prompt in nested {}s, remove unused in_str->promptme memberDenys Vlasenko2011-01-181-21/+11
| | | | | | | | | | | | | function old new delta setup_string_in_str 29 38 +9 parse_and_run_stream 79 88 +9 setup_file_in_str 32 39 +7 parse_stream 2430 2422 -8 file_get 262 235 -27 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/2 up/down: 25/-35) Total: -10 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix "cmd & <newline>" problemDenys Vlasenko2011-01-181-5/+16
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mass removal of underscores from _BB_DIR_foo and _BB_SUID_fooDenys Vlasenko2011-01-181-4/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix wrong prompt problem on empty interactive commantsDenys Vlasenko2011-01-071-1/+10
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* hush: fix FEATURE_CLEAN_UP code (was freeing unallocated memory)Denys Vlasenko2010-12-211-45/+49
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* hush: fix build breakage (variable declared in for())Denys Vlasenko2010-12-181-21/+24
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* add if guards around include <malloc.h>Denys Vlasenko2010-12-051-1/+5
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: move G_x_mode define to the more appropriate placeDenys Vlasenko2010-11-281-5/+5
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Support set -o xtrace/noexec alternates for set -x/-nDan Fandrich2010-11-281-6/+14
| | | | | Signed-off-by: Dan Fandrich <dan@coneharvesters.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: display useful help textDan Fandrich2010-11-281-2/+8
| | | | | Signed-off-by: Dan Fandrich <dan@coneharvesters.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fixes for bugs discovered by randomconfig builds and testsDenys Vlasenko2010-11-221-2/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix improper handling of newline and hash chars in few corner casesDenys Vlasenko2010-11-221-123/+130
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* hush: add support for "set -o pipefail"Denys Vlasenko2010-11-141-23/+101
| | | | | | | | | | | | function old new delta checkjobs 467 517 +50 builtin_set 259 286 +27 o_opt_strings - 10 +10 hush_main 1011 1013 +2 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 3/0 up/down: 89/0) Total: 89 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: preparatory patch for set -o pipefail supportDenys Vlasenko2010-11-141-4/+5
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: whitespace fixesDenys Vlasenko2010-10-281-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: remove "doesn't support brace expansion" from config help textDenys Vlasenko2010-10-041-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: remove brace expansion from TODO list in comments. No code changes.Denys Vlasenko2010-10-031-4/+5
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: small code shrinkDenys Vlasenko2010-10-031-2/+6
| | | | | | | function old new delta expand_on_ifs 231 222 -9 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: implement brace expansionDenys Vlasenko2010-10-031-5/+20
| | | | | | | | | | | | | | | When enabled: function old new delta glob_brace - 402 +402 next_brace_sub - 70 +70 expand_on_ifs 185 231 +46 bbconfig_config_bz2 4923 4929 +6 o_save_ptr 282 140 -142 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 2/1 up/down: 524/-142) Total: 382 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: preparatory patch, no code changesDenys Vlasenko2010-10-031-25/+26
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: use smaller EXP_FLAG_foo constantsDenys Vlasenko2010-09-211-11/+11
| | | | | | | | | | function old new delta expand_string_to_string 126 124 -2 parse_stream 2376 2370 -6 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-8) Total: -8 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* hush: move shell_ver from globals to main's stack.Denys Vlasenko2010-09-161-8/+9
| | | | | | | | | | | | | | | | | | function old new delta hush_main 995 1011 +16 pseudo_exec_argv 253 251 -2 execvp_or_die 50 48 -2 maybe_set_to_sigexit 50 47 -3 hush_exit 78 75 -3 builtin_wait 274 271 -3 check_and_run_traps 205 200 -5 init_sigmasks 214 190 -24 builtin_trap 465 441 -24 reset_traps_to_defaults 238 211 -27 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/9 up/down: 16/-93) Total: -77 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* shell/math: deconvolute and explain ?: handling. Give better error messageDenys Vlasenko2010-09-161-2/+2
| | | | | | | function old new delta arith_apply 1271 1283 +12 Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* shell/math: return string error indicator, not integerDenys Vlasenko2010-09-151-25/+15
| | | | | | | | | | | | | | | | function old new delta expand_and_evaluate_arith 87 106 +19 expand_one_var 1563 1570 +7 arith 12 18 +6 evaluate_string 678 680 +2 arith_apply 1269 1271 +2 builtin_umask 133 132 -1 ash_arith 118 75 -43 expand_vars_to_list 1094 1038 -56 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 5/3 up/down: 36/-100) Total: -64 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* shell/math.c: rename arith_eval_hooks to arith_state, put error code into itDenys Vlasenko2010-09-131-5/+6
| | | | | | | | | | | | | function old new delta expand_and_evaluate_arith 79 89 +10 arith 675 674 -1 arith_lookup_val 151 142 -9 ash_arith 135 122 -13 arith_apply 1304 1269 -35 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/4 up/down: 10/-58) Total: -48 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* shell: shrink arith code; and prepare for returning text error codesDenys Vlasenko2010-09-131-4/+4
| | | | | | | function old new delta arith 701 680 -21 Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* hush: optional support for history savingDenys Vlasenko2010-09-121-0/+20
| | | | | | | function old new delta hush_main 945 995 +50 Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* hush: move the EXIT trap comment. no code changesDenys Vlasenko2010-09-121-2/+3
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* hush: fix EXIT trap display inside exit trap handlerDenys Vlasenko2010-09-121-4/+4
| | | | | | | function old new delta hush_exit 84 78 -6 Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* hush: fix handling of \" in quoted/unquoted `cmd`Denys Vlasenko2010-09-121-19/+29
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* hush: remove forgotten commented-out block. no code changesDenys Vlasenko2010-09-101-4/+0
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* hush: do fewer strdups in % and hash expansionsDenys Vlasenko2010-09-101-13/+16
| | | | | | | | function old new delta builtin_umask 133 132 -1 expand_one_var 1552 1543 -9 Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* hush: better function and parameter namesDenys Vlasenko2010-09-101-20/+55
| | | | | | | Also, trim code which isn't needed for non-bash compat. No logic changes. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* hush: fix var_bash5.tests failureDenys Vlasenko2010-09-101-20/+23
| | | | | | | | | | | | | | | | | | | | function old new delta expand_one_var 1513 1552 +39 expand_pseudo_dquoted 118 135 +17 expand_string_to_string 110 126 +16 setup_heredoc 298 308 +10 expand_and_evaluate_arith 69 79 +10 parse_stream_dquoted 233 241 +8 setup_redirects 220 225 +5 run_list 956 961 +5 expand_assignments 76 81 +5 run_pipe 1587 1590 +3 parse_stream 2371 2374 +3 builtin_umask 132 133 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 12/0 up/down: 122/0) Total: 122 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* hush: fix var_bash3.tests failureDenys Vlasenko2010-09-101-13/+15
| | | | | | | | | | | | | | | function old new delta expand_one_var 1513 1538 +25 parse_stream_dquoted 233 241 +8 expand_pseudo_dquoted 118 126 +8 setup_heredoc 298 303 +5 expand_and_evaluate_arith 69 74 +5 parse_stream 2371 2374 +3 builtin_umask 132 133 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 7/0 up/down: 55/0) Total: 55 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* hush: remove useless ESC_GLOB_CHARS clears/resotresDenys Vlasenko2010-09-101-15/+4
| | | | | | | | | | | | function old new delta o_addQstr 43 165 +122 expand_on_ifs 210 189 -21 expand_vars_to_list 1122 1094 -28 o_addqblock 139 - -139 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/2 up/down: 122/-188) Total: -66 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>