aboutsummaryrefslogtreecommitdiff
path: root/shell/hush_test (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* hush testsuite: fix another false positiveDenys Vlasenko2016-10-032-2/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hust testsuite: fix a false positiveDenys Vlasenko2016-10-031-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash testsuite: add most of hust tests which pass for ashDenys Vlasenko2016-10-031-0/+0
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: add var4.tests, var5.testsDenys Vlasenko2016-10-024-0/+22
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix var3.testsDenys Vlasenko2016-10-023-0/+0
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sh testsuite: sync ash-redir/ and hush-redir/Denys Vlasenko2016-10-0212-114/+198
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sh testsuite: sync ash-misc/source* and hush-misc/source*Denys Vlasenko2016-10-028-27/+38
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sh testsuite: sync ash-vars/ and hush-vars/Denys Vlasenko2016-10-023-0/+0
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sh testsuite: create hush-redir/* and move files aroundDenys Vlasenko2016-10-0224-0/+52
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sh testsuite: create hush-heredoc/* and move files aroundDenys Vlasenko2016-10-0214-0/+9
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush testsuite: add many tests from ash testsuiteDenys Vlasenko2016-10-0233-2/+253
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush testsuite: add glob_dir.testsDenys Vlasenko2016-10-023-1/+45
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: expand: Fixed "$@" expansion when EXP_FULL is falseDenys Vlasenko2016-10-022-0/+37
| | | | | | | | | | | | | | | | | | | Upstream commit: Date: Thu, 1 Jan 2015 07:53:10 +1100 expand: Fixed "$@" expansion when EXP_FULL is false The commit 3c06acdac0b1ba0e0acdda513a57ee6e31385dce ([EXPAND] Split unquoted $@/$* correctly when IFS is set but empty) broke the case where $@ is in quotes and EXP_FULL is false. In that case we should still emit IFS as field splitting is not performed. Reported-by: Juergen Daubert <jue@jue.li> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash,hush: add a test that "continue" does not cripple trapsDenys Vlasenko2016-10-012-0/+8
| | | | | | Both shells pass this test. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash testsuite: add return_in_trap1.testsDenys Vlasenko2016-10-0120-0/+0
| | | | | | Currently it fails Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: 'return' should have effect earlierDenys Vlasenko2016-10-012-0/+22
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: [EXPAND] Do not split quoted VSLENGTH and VSTRIMDenys Vlasenko2016-10-014-0/+33
| | | | | | | | | | | | | | Upstream patch: Date: Wed, 8 Oct 2014 15:42:08 +0800 [EXPAND] Do not split quoted VSLENGTH and VSTRIM Currently VSLENGTH and VSTRIM* are field-split even within quotes. This is obviously wrong. This patch fixes that. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: [EXPAND] Split unquoted $@/$* correctly when IFS is set but emptyDenys Vlasenko2016-10-012-0/+46
| | | | | | | | | | | | | | Upstream commit: Date: Wed, 8 Oct 2014 15:24:23 +0800 [EXPAND] Split unquoted $@/$* correctly when IFS is set but empty Currently we do not field-split $@/$* when it isn't quoted and IFS is set but empty. This is obviously wrong. This patch fixes this. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: add func6.testsDenys Vlasenko2016-10-012-0/+13
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shell testsuite: add trailing newline to var_unbackslash1.testsDenys Vlasenko2016-09-291-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: fix arithmetic closing )) split by backslash-newlineDenys Vlasenko2016-09-292-0/+24
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: rework input char buffering to allow more than one-deep peekDenys Vlasenko2016-09-292-0/+18
| | | | | | | | | | | | | | | | | | | | | This fixes backslash+newline continuation in $VAR\ NAME construct. (ash has a bug there as well). function old new delta file_peek2 - 74 +74 parse_dollar 746 773 +27 expand_vars_to_list 1143 1167 +24 setup_string_in_str 32 46 +14 setup_file_in_str 33 47 +14 file_get 264 278 +14 static_peek2 - 7 +7 file_peek 91 72 -19 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 5/1 up/down: 174/-19) Total: 155 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix 'eval ""' handlingDenys Vlasenko2016-09-292-0/+7
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix ". EMPTY_LINE" not setting $? to 0Denys Vlasenko2016-09-292-0/+8
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: [EVAL] Make eval with empty arguments return 0Denys Vlasenko2016-09-292-0/+5
| | | | | | | | This is a backport of upstream commit: [EVAL] Make eval with empty arguments return 0 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: eval: Return status in eval functionsDenys Vlasenko2016-09-282-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backported from dash: eval: Return status in eval functions The exit status is currently clobbered too early for case statements and loops. This patch fixes it by making the eval functions return the current exit status and setting them in one place -- evaltree. Harald van Dijk pointed out a number of bugs in the original patch. function old new delta evalcommand 1226 1242 +16 cmdloop 383 398 +15 evalfor 223 227 +4 evalcase 271 275 +4 localcmd 348 350 +2 evaltreenr 927 928 +1 evaltree 927 928 +1 evalsubshell 150 151 +1 evalpipe 356 357 +1 parse_command 1585 1584 -1 evalloop 177 164 -13 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 9/2 up/down: 45/-14) Total: 31 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix "redirects can close script fd" bugDenys Vlasenko2016-08-222-0/+30
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix a bug in FEATURE_SH_STANDALONE=y config. Closes 9186Denys Vlasenko2016-08-191-1/+2
| | | | | | | | | | | | | | | | | | | | | Run this in a "sh SCRIPT": sha256sum /dev/null echo END sha256sum is a NOEXEC applet. It runs in a forked child. Then child exit()s. By this time, entire script is read, and buffered in a FILE object from fopen("SCRIPT"). But fgetc() did not consume entire input. exit() lseeks back by -9 bytes, from <eof> to 'e' in 'echo'. (this may be libc-specific). This change of fd position *is shared with the parent*! Now parent can read more, and it thinks there is another "echo END". End result: two "echo END"s are run. Fix this by _exit()ing instead. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush-misc/func_args1.tests: remove "UNFIXED BUG", it does not failDenys Vlasenko2015-11-041-2/+0
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: copy for.tests from ash testsuiteDenys Vlasenko2015-10-292-0/+6
| | | | | | This test passes for hush Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* typo fixDenys Vlasenko2015-10-131-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix a nommu bug where a part of function body is lost if run in a pipeDenys Vlasenko2015-09-042-0/+17
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash,hush: add a test which fails for ash since commit 549deabDenys Vlasenko2015-09-042-0/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: add recent ash tests to hush testsuite too (they all pass for hush)Denys Vlasenko2015-05-1818-0/+29
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: document buggy handling of duplicate "local"Denys Vlasenko2015-04-182-0/+6
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: make ${#var} unicode-awareDenys Vlasenko2014-08-132-0/+16
| | | | | | This mimics bash Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix for "while false && true; do echo BUG; break; done". closes 6170Denys Vlasenko2013-04-072-0/+7
| | | | | | | function old new delta run_list 959 941 -18 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: source builtin should override $N only if it has argsDenys Vlasenko2013-03-172-0/+12
| | | | | | | function old new delta builtin_source 174 184 +10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* 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>