summaryrefslogtreecommitdiff
path: root/shell/hush.c
AgeCommit message (Collapse)Author
2011-02-02hush: use FEATURE_SH_NOFORK to enable NOFORK trickDenys Vlasenko
Also expands docs Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-01-18hush: improve prompt in nested {}s, remove unused in_str->promptme memberDenys Vlasenko
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>
2011-01-18hush: fix "cmd & <newline>" problemDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-01-18mass removal of underscores from _BB_DIR_foo and _BB_SUID_fooDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-01-07hush: fix wrong prompt problem on empty interactive commantsDenys Vlasenko
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-12-21hush: fix FEATURE_CLEAN_UP code (was freeing unallocated memory)Denys Vlasenko
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-12-18hush: fix build breakage (variable declared in for())Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-12-05add if guards around include <malloc.h>Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-11-28hush: move G_x_mode define to the more appropriate placeDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-11-28Support set -o xtrace/noexec alternates for set -x/-nDan Fandrich
Signed-off-by: Dan Fandrich <dan@coneharvesters.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-11-28hush: display useful help textDan Fandrich
Signed-off-by: Dan Fandrich <dan@coneharvesters.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-11-22fixes for bugs discovered by randomconfig builds and testsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-11-22hush: fix improper handling of newline and hash chars in few corner casesDenys Vlasenko
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-11-14hush: add support for "set -o pipefail"Denys Vlasenko
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>
2010-11-14hush: preparatory patch for set -o pipefail supportDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-28*: whitespace fixesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-04hush: remove "doesn't support brace expansion" from config help textDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-03hush: remove brace expansion from TODO list in comments. No code changes.Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-03hush: small code shrinkDenys Vlasenko
function old new delta expand_on_ifs 231 222 -9 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-03hush: implement brace expansionDenys Vlasenko
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>
2010-10-03hush: preparatory patch, no code changesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-09-21hush: use smaller EXP_FLAG_foo constantsDenys Vlasenko
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>
2010-09-16hush: move shell_ver from globals to main's stack.Denys Vlasenko
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>
2010-09-16shell/math: deconvolute and explain ?: handling. Give better error messageDenys Vlasenko
function old new delta arith_apply 1271 1283 +12 Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-15shell/math: return string error indicator, not integerDenys Vlasenko
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>
2010-09-13shell/math.c: rename arith_eval_hooks to arith_state, put error code into itDenys Vlasenko
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>
2010-09-13shell: shrink arith code; and prepare for returning text error codesDenys Vlasenko
function old new delta arith 701 680 -21 Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-12hush: optional support for history savingDenys Vlasenko
function old new delta hush_main 945 995 +50 Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-12hush: move the EXIT trap comment. no code changesDenys Vlasenko
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-12hush: fix EXIT trap display inside exit trap handlerDenys Vlasenko
function old new delta hush_exit 84 78 -6 Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-12hush: fix handling of \" in quoted/unquoted `cmd`Denys Vlasenko
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-10hush: remove forgotten commented-out block. no code changesDenys Vlasenko
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-10hush: do fewer strdups in % and hash expansionsDenys Vlasenko
function old new delta builtin_umask 133 132 -1 expand_one_var 1552 1543 -9 Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-10hush: better function and parameter namesDenys Vlasenko
Also, trim code which isn't needed for non-bash compat. No logic changes. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-10hush: fix var_bash5.tests failureDenys Vlasenko
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>
2010-09-10hush: fix var_bash3.tests failureDenys Vlasenko
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>
2010-09-10hush: remove useless ESC_GLOB_CHARS clears/resotresDenys Vlasenko
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>
2010-09-09hush: fix a bug where expand_one_var wasn't restoring 1st char of the ↵Denys Vlasenko
encoded $var function old new delta expand_one_var 1515 1513 -2 expand_vars_to_list 1133 1122 -11 Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-09hush: make parse_dollar flag quited status regardless of glob escaping statusDenys Vlasenko
function old new delta parse_stream_dquoted 228 233 +5 parse_stream 2369 2371 +2 parse_dollar 730 717 -13 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 7/-13) Total: -6 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-09hush: simplification in parse_stream, parse_stream_dquotedDenys Vlasenko
function old new delta parse_stream 2354 2369 +15 parse_stream_dquoted 250 228 -22 Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-09hush: simplify parse_stream_dquotedDenys Vlasenko
function old new delta parse_stream_dquoted 303 250 -53 Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-09hush: straighten out the logic in parse_streamDenys Vlasenko
function old new delta parse_stream 2399 2354 -45 Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-08hush: eliminate redundant parameter of expand_vars_to_list()Denys Vlasenko
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-08hush: replace flag bytes in struct o_string with bit flagsDenys Vlasenko
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-08hush: remove unused enum typedefDenys Vlasenko
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-08hush: fix set -- q w e; (IFS='' echo "$*"; IFS=''; echo "$*"); echo "$*"Denys Vlasenko
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-07shell: unify endofname() in hush and ashDenys Vlasenko
function old new delta builtin_umask 132 133 +1 changepath 195 194 -1 expand_and_evaluate_arith 77 69 -8 ash_arith 143 135 -8 expand_one_var 1551 1515 -36 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/4 up/down: 1/-53) Total: -52 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-07hush: a few relatively trivial simplificationsDenys Vlasenko
function old new delta helper_export_local 130 135 +5 set_vars_and_save_old 89 85 -4 expand_variables 147 141 -6 get_ptr_to_local_var 77 70 -7 get_local_var_value 171 164 -7 delete_finished_bg_job 31 16 -15 hush_exit 101 84 -17 free_pipe_list 31 12 -19 check_and_run_traps 232 205 -27 free_pipe 205 130 -75 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/9 up/down: 5/-177) Total: -172 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-07hush: style cleanups. no code changesDenys Vlasenko
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-06hush: revert a recent buggy change which resulted in two HUSH_VERSIONsDenys Vlasenko
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>