aboutsummaryrefslogtreecommitdiff
path: root/shell/ash_test (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* hush: fix and_or_and_backgrounding.tests failureDenys Vlasenko2017-07-152-0/+35
| | | | | | | function old new delta done_pipe 133 218 +85 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix "(sleep 1; exit 3) & sleep 2; echo $?; wait $!; echo $?"Denys Vlasenko2017-07-072-0/+8
| | | | | | | | | | | function old new delta process_wait_result 414 426 +12 builtin_wait 283 291 +8 run_list 974 978 +4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 24/0) Total: 24 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shell: sync redir/* testsDenys Vlasenko2017-07-062-0/+17
| | | | | | Note: hush-redir/redir_to_bad_fd.tests currently fails Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: rename redir5.tests (hush has redir5.tests which is different)Denys Vlasenko2017-07-063-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: Print error messages on shift -1Denys Vlasenko2017-07-061-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* typo fixDenys Vlasenko2017-07-061-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: implement negative start in the ${v: -n[:m]} idiomDenys Vlasenko2017-07-062-0/+14
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: "adopt" ash var-utf8-length.testsDenys Vlasenko2017-07-061-0/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shell: remove duplicate sigint1.tests (another copies are in signals/)Denys Vlasenko2017-07-062-42/+0
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: add tickquote1.tests from ash testsuiteDenys Vlasenko2017-07-061-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shell: syncronize ash and hush heredoc3.testsDenys Vlasenko2017-07-064-10/+31
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shell: syncronize ash and hush heredoc1.testsDenys Vlasenko2017-07-064-4/+18
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shell: syncronize ash_test/run-all and hush_test/run-all a bitDenys Vlasenko2017-07-061-48/+54
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: fix escaping of a few characters (broken by last commits)Denys Vlasenko2017-07-052-0/+76
| | | | | | | Add a testcase which tests all ASCII punctuation escapes. NB: hush is failing this test! Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: fix matching of unicode greek letter rho (cf 81) and similar casesDenys Vlasenko2017-07-052-0/+34
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* msh: delete this appletDenys Vlasenko2017-07-031-3/+3
| | | | | | It's deprecated since 2009 and interferes with make_single_applets.sh tests. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash,hush: fix SIGCHLD interrupting read builtinDenys Vlasenko2017-05-222-0/+6
| | | | | | | | | | | | function old new delta readcmd 169 217 +48 shell_builtin_read 1087 1097 +10 localcmd 366 364 -2 builtin_read 197 193 -4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/2 up/down: 58/-6) Total: 52 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Spelling fixes in comments, documentation, tests and examplesDenys Vlasenko2017-04-171-1/+1
| | | | | | By klemens <ka7@github.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix a bug in argv restoration after sourcing a fileDenys Vlasenko2017-01-092-0/+16
| | | | | | if sourced file "shift"ed argvs so that $1 is NULL, restore wasn't done. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: fix open fds leaking in redirects. Closes 9561Denys Vlasenko2017-01-072-0/+16
| | | | | | | | | | | | | | | commit e19923f6652a638ac39c84012e97f52cf5a7568e deleted clearredir() call in shellexec(): ash: [REDIR] Remove redundant CLOEXEC calls Upstream commit: Now that we're marking file descriptors as CLOEXEC in savefd, we no longer need to close them on exec or in setinputfd. but it missed one place where we don't set CLOEXEC. Fixing this. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: fix error code regressionRon Yorston2017-01-032-0/+16
| | | | | | | | | | | | | | | | | | | | | | The commit 'ash,hush: set exit code 127 in "sh /does/not/exist" case' only partly implemented the dash commit '[ERROR] Allow the originator of EXERROR to set the exit status'. This resulted in incorrect error codes for a syntax error: $ ) $ echo $? 0 or a redirection error for a special builtin: $ rm -f xxx $ eval cat <xxx $ echo $? 0 Signed-off-by: Ron Yorston <rmy@pobox.com> Reported-by: Martijn Dekker <martijn@inlv.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: rework "wait %jobspec" to work in non-interactive shells tooDenys Vlasenko2016-11-084-0/+10
| | | | | | | | | Also add tests. wait5.tests so far fails (but works for ash and dash). function old new delta builtin_wait 305 283 -22 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: allow { cmd } to not be terminated by semicolon in some casesDenys Vlasenko2016-11-042-0/+16
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: fix interactive "command eval STRING" exiting on errors.Denys Vlasenko2016-10-282-0/+9
| | | | | | This bug is also present in current dash Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: [PARSER] Recognise here-doc delimiters terminated by EOFDenys Vlasenko2016-10-264-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Upstream commit 1: Date: Wed, 26 Sep 2007 17:14:16 +0800 [PARSER] Recognise here-doc delimiters terminated by EOF Previously dash required a <newline> character to be present in order for a here-document delimiter to be detected. Allowing EOF in the absence of a <newline> to play the same purpose allows some intuitive scripts to succeed. POSIX seems to be silence on this so this should be OK. Test case: eval 'cat <<- NOT test NOT' echo OK Old result: test NOTOK New result: test OK Upstream commit 2: Date: Sat, 20 Oct 2007 18:49:31 +0800 [PARSER] Fix here-doc corruption The change [PARSER] Recognise here-doc delimiters terminated by EOF introduced a regerssion whereby lines starting with eofmark but are not equal to eofmark would be corrupted. This patch fixes it. Test case: cat << _ACEOF _ASBOX _ACEOF Old result: SASBOX New result: _ASBOX Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: [PARSER] Fix parsing of ${##1}Denys Vlasenko2016-10-262-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | Upstream commit: Date: Thu, 4 Oct 2007 22:15:10 +0800 [PARSER] Fix parsing of ${##1} Previously dash treated ${##1} as a length operation. This patch fixes that. Test case: set -- a echo ${##1}OK Old result: 1OK New result: OK This was a real bug in ash (but not in hush). Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* typo fixesDenys Vlasenko2016-10-261-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash testsuite: fix false positivesDenys Vlasenko2016-10-072-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sh testsuite: add tests for exitcode on failure to execDenys Vlasenko2016-10-034-0/+8
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash testsuite: add most of hust tests which pass for ashDenys Vlasenko2016-10-03102-0/+795
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sh testsuite: sync ash-redir/ and hush-redir/Denys Vlasenko2016-10-026-0/+115
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sh testsuite: sync ash-misc/source* and hush-misc/source*Denys Vlasenko2016-10-022-0/+12
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sh testsuite: sync ash-vars/ and hush-vars/Denys Vlasenko2016-10-028-20/+39
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash testsuite: update some of variable tests with newer versions from hushDenys Vlasenko2016-10-026-25/+156
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sh testsuite: create hush-redir/* and move files aroundDenys Vlasenko2016-10-026-0/+91
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sh testsuite: create hush-heredoc/* and move files aroundDenys Vlasenko2016-10-022-0/+21
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush testsuite: add many tests from ash testsuiteDenys Vlasenko2016-10-021-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: fix globbing bugs when using glibc glob()Denys Vlasenko2016-10-022-0/+44
| | | | 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-012-0/+22
| | | | | | Currently it fails 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>
* ash: fix "return N" not setting $? in loop conditionalsDenys Vlasenko2016-10-012-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Upstream commit 1: Date: Mon, 6 Oct 2014 20:45:04 +0800 [EVAL] Move common skipcount logic into skiploop The functions evalloop and evalfor share the logic on checking and updating skipcount. This patch moves that into the helper function skiploop. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Upstream commit 2: Date: Mon, 6 Oct 2014 21:22:43 +0800 [BUILTIN] Allow return in loop conditional to set exit status https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=332954 When return is used in a loop conditional the exit status will be lost because we always set the exit status at the end of the loop to that of the last command executed in the body. This is counterintuitive and contrary to what most other shells do. This patch fixes this by always preserving the exit status of return when it is used in a loop conditional. The patch was originally written by Gerrit Pape <pape@smarden.org>. Reported-by: Stephane Chazelas <stephane_chazelas@yahoo.fr> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash testsuite: remove two more inadvertent bashismsDenys Vlasenko2016-10-012-7/+7
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash testsuite: remove two inadvertent bashismsDenys Vlasenko2016-10-012-3/+5
| | | | 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-298-0/+159
| | | | | | | | | | | | | | | | | | | | | 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>