aboutsummaryrefslogtreecommitdiff
path: root/shell/hush_test (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* *: trailing empty lines removedDenys Vlasenko2010-07-261-1/+0
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: fix $! value when traps are setAlexander Shishkin2010-07-252-0/+19
| | | | | Signed-off-by: Alexander Shishkin <virtuoso@slind.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix multimple dependent variable expansion casesDenys Vlasenko2010-07-162-0/+27
| | | | | | | | | | | | | | | | function old new delta get_local_var_value 100 171 +71 expand_assignments 46 76 +30 reset_traps_to_defaults 229 238 +9 maybe_set_to_sigexit 47 50 +3 init_sigmasks 211 214 +3 builtin_trap 462 465 +3 expand_vars_to_list 2412 2408 -4 run_pipe 1568 1533 -35 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 6/2 up/down: 119/-39) Total: 80 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix segfault in ${?:N:M}Denys Vlasenko2010-05-224-3/+31
| | | | | | | | | | | function old new delta expand_vars_to_list 2374 2409 +35 builtin_umask 132 133 +1 builtin_exit 47 48 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 37/0) Total: 37 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix "hush -c 'echo $#'" showing -1Denys Vlasenko2010-05-222-1/+11
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: support ${var:EXPR:EXPR}!Denys Vlasenko2010-05-222-44/+64
| | | | | | | | | | | | | function old new delta handle_dollar 574 681 +107 expand_and_evaluate_arith - 77 +77 expand_vars_to_list 2302 2374 +72 add_till_closing_bracket 359 368 +9 builtin_exit 48 47 -1 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 3/1 up/down: 265/-1) Total: 264 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix more obscure ${var%...} casesDenys Vlasenko2010-05-224-8/+22
| | | | | | | | function old new delta add_till_closing_paren 313 359 +46 builtin_exit 48 47 -1 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix a=abc; c=c; echo ${a%${c}}Denys Vlasenko2010-05-213-5/+12
| | | | | | | | | | | function old new delta expand_vars_to_list 2229 2302 +73 add_till_closing_paren 286 313 +27 handle_dollar 623 574 -49 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 100/-49) Total: 51 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: handle expansions in ${var?expanded_word} constructsDenys Vlasenko2010-05-212-0/+35
| | | | | | | function old new delta expand_vars_to_list 2209 2229 +20 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: handle ${var:NUM:} tooDenys Vlasenko2010-05-212-0/+24
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: optional support for ${var:N:M} bashismDenys Vlasenko2010-05-212-0/+75
| | | | | | | | function old new delta expand_vars_to_list 1999 2183 +184 handle_dollar 682 623 -59 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix var=`exit 2` not setting $? to 2Denys Vlasenko2010-05-202-0/+49
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix hush-bugs/parse_err.testsDenys Vlasenko2010-05-173-3/+3
| | | | | | | | | function old new delta parse_stream 2325 2339 +14 builtin_umask 121 123 +2 builtin_type 116 114 -2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* add two more tests which currently failDenys Vlasenko2010-05-172-0/+5
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* whitespace fixesDenys Vlasenko2010-01-251-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: use ash's read builtinDenys Vlasenko2010-01-1210-0/+54
| | | | | | | | | | | | | | | | | function old new delta shell_builtin_read - 1000 +1000 set_local_var_from_halves - 24 +24 setvar2 - 7 +7 ... popstring 140 134 -6 ash_main 1375 1368 -7 setvar 184 174 -10 arith_set_local_var 36 - -36 builtin_read 1096 185 -911 ------------------------------------------------------------------------------ (add/remove: 3/1 grow/shrink: 5/23 up/down: 1038/-1007) Total: 31 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix subshell.tests failure on NOMMUDenys Vlasenko2010-01-122-5/+20
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: two NOMMU fixes for bugs 877 and 883Denys Vlasenko2010-01-122-0/+10
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: plug a memory leakDenys Vlasenko2010-01-122-0/+31
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix exitcodes of killed processesDenys Vlasenko2010-01-042-0/+14
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: improve HUSH_BRACE_EXP code (still disabled). ~0 bytesDenys Vlasenko2009-11-172-0/+8
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix handling of words with braces. +65 bytesDenys Vlasenko2009-11-162-0/+14
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix exit code propagation from `cmd`. +45 bytesDenys Vlasenko2009-11-162-8/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: wait for `cmd` to complete, and immediately store its exitcode in $?Denys Vlasenko2009-11-152-0/+2
| | | | | | | function old new delta expand_vars_to_list 2129 2197 +68 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix exec builtin in a better way (+ "glob in exec" bug fixed)Denys Vlasenko2009-10-191-3/+2
| | | | | | | | | | | | function old new delta execvp_or_die - 50 +50 static.pseudo_null_str 3 - -3 builtin_exec 83 57 -26 pseudo_exec_argv 200 163 -37 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 0/2 up/down: 50/-66) Total: -16 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix handling of empty argumentsDenys Vlasenko2009-10-184-4/+26
| | | | | | | | | | | | function old new delta builtin_exec 25 83 +58 parse_stream 2242 2261 +19 run_pipe 1782 1787 +5 static.pseudo_null_str - 3 +3 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 3/0 up/down: 85/0) Total: 85 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: handle empty execsMike Frysinger2009-10-182-0/+30
| | | | | | | | Sometimes variable expansions yield empty strings, and if they happen to be a command someone wants to run like `$foo`, then hush currently segfaults. So handle `` and $(). Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* typo fix in a comment in a testcase. oh well...Denys Vlasenko2009-09-301-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash,hush: make trap output short signal names, without SIG prefixDenys Vlasenko2009-09-272-9/+9
| | | | | | | | | function old new delta evalvar 1373 1371 -2 builtin_trap 457 441 -16 trapcmd 260 236 -24 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: do not reset to default "" traps in subshellDenys Vlasenko2009-09-252-0/+26
| | | | | | | | function old new delta reset_traps_to_defaults 164 211 +47 builtin_umask 123 121 -2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: better handling of EXIT trap in `trap` hackDenys Vlasenko2009-09-252-2/+10
| | | | | | | | | | | | | | function old new delta forkchild - 602 +602 trapcmd 255 347 +92 ash_main 1362 1375 +13 evalvar 1371 1373 +2 popstring 140 134 -6 forkshell 835 248 -587 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 3/2 up/down: 709/-593) Total: 116 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash,hush: fix trap reporting: s/SIGEXIT/EXIT/Denys Vlasenko2009-09-241-6/+6
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix `trap`Denys Vlasenko2009-09-232-0/+9
| | | | | | | | function old new delta expand_variables 2217 2280 +63 static.argv - 8 +8 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: do not process options after non-option argsDenys Vlasenko2009-08-202-0/+7
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hust test: complain if busybox binary can't be foundDenys Vlasenko2009-08-121-6/+10
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix \<newline> handling on NOMMUDenys Vlasenko2009-08-123-10/+29
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush tests: remove the requirement that .config is in ../..Denys Vlasenko2009-08-121-4/+10
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: do not use ps -o in leak_argv1; do not hardcode path in negateDenys Vlasenko2009-08-124-50/+17
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: specially handle [[ - suppress globbing & multiword expansionDenys Vlasenko2009-06-092-0/+26
| | | | | | It's a bashism, but is surprisingly easy to do and costs very little code. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: add support for local builtinDenys Vlasenko2009-06-034-0/+29
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush_test: stop mixing tabs/spaces for indentationMike Frysinger2009-06-011-37/+37
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* hush: add support for special vars in bracesMike Frysinger2009-06-016-8/+6
| | | | | | | Some people like to use ${?} rather than $?, so make sure we support all the special single char vars that use this form. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* hush_test: filter test output to avoid C lib differencesMike Frysinger2009-06-011-0/+4
| | | | | | | | The getopt function in some C libraries wraps the option in single quotes while others do not. Avoid the issue by running sed on the output and strip all quotes. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* hush: fix bug 353 (wrong handling of \x in assignments)Denys Vlasenko2009-05-282-0/+16
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* make compound.tests executableDenys Vlasenko2009-05-231-0/+0
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix problems with case in subshells and with "case esac"Denys Vlasenko2009-05-233-7/+18
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush_test: add some pathological compound list testsMike Frysinger2009-05-212-0/+35
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* hush_test: test for subshell function syntaxMike Frysinger2009-05-212-0/+12
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* hush_test: add subshelled case testsMike Frysinger2009-05-211-0/+12
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* hush_test: update test output to match new getopt() outputMike Frysinger2009-05-211-1/+1
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>