busybox/shell/ash_test
Denys Vlasenko 8c68ae8416 ash: parser: Fix alias expansion after heredoc or newlines
Upstream commit:

    Date: Wed, 29 Apr 2020 00:19:59 +1000
    parser: Fix alias expansion after heredoc or newlines

    This script should print OK:

        alias a="case x in " b=x
        a
        b) echo BAD;; esac

        alias BEGIN={ END=}
        BEGIN
    	cat <<- EOF > /dev/null
    		$(:)
    	EOF
        END
        : <<- EOF &&
    		$(:)
        EOF
        BEGIN
    	echo OK
        END

    However, because the value of checkkwd is either zeroed when it
    shouldn't, or isn't zeroed when it should, dash currently gets
    it wrong in every case.

    This patch fixes it by saving checkkwd and zeroing it where needed.

function                                             old     new   delta
readtoken                                            157     176     +19

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-09-08 01:43:12 +02:00
..
ash-alias ash: parser: Fix alias expansion after heredoc or newlines 2021-09-08 01:43:12 +02:00
ash-arith ash: parser: Add syntax stack for recursive parsing 2018-04-02 13:15:37 +02:00
ash-getopts hush: fix "getopts" builtin to not be upset by other builtins calling getopt() 2017-08-29 13:38:30 +02:00
ash-glob ash: expand: Do not quote backslashes in unquoted parameter expansion 2018-08-07 18:58:02 +02:00
ash-heredoc ash: Expand here-documents in the current shell environment 2020-02-22 20:29:36 +01:00
ash-invert add ash testcases 2007-03-05 20:46:46 +00:00
ash-misc ash: LINENO starts from 0 in -c SCRIPT mode 2021-09-07 18:16:45 +02:00
ash-parsing ash: LINENO starts from 0 in -c SCRIPT mode 2021-09-07 18:16:45 +02:00
ash-psubst ash: LINENO starts from 0 in -c SCRIPT mode 2021-09-07 18:16:45 +02:00
ash-quoting ash: expand: Ensure result is escaped in cvtnum 2020-02-21 16:30:44 +01:00
ash-read shell: Fix "read -d ''" behavior 2020-07-31 18:42:30 +02:00
ash-redir ash: eval: Fail immediately with redirections errors for simple command 2020-02-20 09:36:51 +01:00
ash-signals hush: output bash-compat killing signal names 2020-10-24 04:26:43 +02:00
ash-standalone ash: fix nofork bug where environment is not properly passed to a command 2017-11-03 14:16:25 +01:00
ash-vars ash: LINENO starts from 0 in -c SCRIPT mode 2021-09-07 18:16:45 +02:00
ash-z_slow hush: improve ${var#...}, ${var:+...} and ${var/.../...} - handle quoting 2018-07-17 14:21:38 +02:00
.gitignore ash_test: ignore generated files 2016-03-22 18:15:24 -04:00
printenv.c do not use `a' quoting style in comments 2017-08-02 14:26:33 +02:00
recho.c whitespace cleanup 2010-10-29 11:46:52 +02:00
run-all shell/ash_test/run-all: unset locale/language variables 2021-09-07 18:24:08 +02:00
zecho.c whitespace cleanup 2010-10-29 11:46:52 +02:00