aboutsummaryrefslogtreecommitdiff
path: root/shell/hush_test (follow)
Commit message (Collapse)AuthorAgeFilesLines
* hush: fix remaining known two bugs with IFS expansion. Closes 4027.Denys Vlasenko2011-08-012-3/+6
| | | | | | | | | | | | | function old new delta expand_vars_to_list 1054 1140 +86 parse_stream 2425 2479 +54 expand_on_ifs 258 310 +52 builtin_umask 133 132 -1 done_word 820 779 -41 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/2 up/down: 192/-42) Total: 150 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: partially fix wrong expansion on $IFS (bug 4027).Denys Vlasenko2011-08-012-0/+20
| | | | | | | | | | | | | | | | In the added testcase, before patch we failed 8 out of 9 tests, now we fail only 2 (4th and 5th). function old new delta expand_on_ifs 225 258 +33 expand_vars_to_list 1038 1054 +16 o_save_ptr_helper 115 119 +4 builtin_umask 132 133 +1 o_addQstr 165 161 -4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/1 up/down: 54/-4) Total: 50 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix a corner case of empty "do \n done" structureDenys Vlasenko2011-05-312-0/+5
| | | | | | | | | | | | The structure is: while cmd; do done bash doesn't accept it at all. We were accepting it but execution was buggy. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix misparsing of "... do eval a= ...". Closes 3721Denys Vlasenko2011-05-142-0/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: add tests for interrupting readDenys Vlasenko2011-05-095-4/+21
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: document a bug about aborting on sourced file error when non-interactiveDenys Vlasenko2011-03-242-0/+15
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix a case where return in sourced file has no effectDenys Vlasenko2011-03-242-0/+5
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* slightly better wording in commentsDenys Vlasenko2011-02-211-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: fix ash-signals/signal8 testcase failureDenys Vlasenko2011-02-212-0/+42
| | | | | | | | | | | function old new delta killcmd 109 224 +115 kill_main 882 910 +28 changepath 194 195 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 144/0) Total: 144 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* echo: do not retry on write errorsDenys Vlasenko2011-02-072-0/+9
| | | | | | | | | | | | | 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: fix improper handling of newline and hash chars in few corner casesDenys Vlasenko2010-11-226-0/+30
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* hush: add support for "set -o pipefail"Denys Vlasenko2010-11-142-0/+85
| | | | | | | | | | | | 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: add brace expansion testcaseDenys Vlasenko2010-10-032-0/+14
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shell/math: deconvolute and explain ?: handling. Give better error messageDenys Vlasenko2010-09-161-1/+1
| | | | | | | 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-27/+27
| | | | | | | | | | | | | | | | 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>
* hush: fix EXIT trap display inside exit trap handlerDenys Vlasenko2010-09-122-0/+41
| | | | | | | 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-124-3/+21
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* hush: do fewer strdups in % and hash expansionsDenys Vlasenko2010-09-102-0/+14
| | | | | | | | function old new delta builtin_umask 133 132 -1 expand_one_var 1552 1543 -9 Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* hush: fixes to testsuiteDenys Vlasenko2010-09-102-6/+8
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* hush: fix var_bash5.tests failureDenys Vlasenko2010-09-102-6/+31
| | | | | | | | | | | | | | | | | | | | 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: make parse_dollar flag quited status regardless of glob escaping statusDenys Vlasenko2010-09-092-13/+13
| | | | | | | | | | | 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>
* hush: fix another corner case with backslashes in heredocsDenys Vlasenko2010-09-062-0/+16
| | | | | | | function old new delta parse_stream 2395 2432 +37 Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* hush: fix backslash and terminator handling in <<[-]["]heredoc["]Denys Vlasenko2010-09-062-0/+81
| | | | | | | | | | | function old new delta parse_stream 2339 2395 +56 expand_pseudo_dquoted 104 118 +14 parse_stream_dquoted 296 300 +4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 74/0) Total: 74 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* hush: fix globbing+backslashes in unquoted $var expansionDenys Vlasenko2010-09-064-13/+109
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* hush: add support for ${var/pattern/repl}, conditional on bash compatDenys Vlasenko2010-09-0510-0/+212
| | | | | | | | | | | | function old new delta expand_vars_to_list 2386 2833 +447 expand_string_to_string 69 110 +41 parse_dollar 681 721 +40 hush_main 963 945 -18 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/1 up/down: 528/-18) Total: 510 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* hush: fix handling of backslashes in variable assignmentDenys Vlasenko2010-09-042-0/+34
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* *: 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>