busybox/shell/ash_test/ash-alias
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
..
alias_brace.right ash: parser: Fix alias expansion after heredoc or newlines 2021-09-08 01:43:12 +02:00
alias_brace.tests ash: parser: Fix alias expansion after heredoc or newlines 2021-09-08 01:43:12 +02:00
alias_case.right ash: parser: Fix alias expansion after heredoc or newlines 2021-09-08 01:43:12 +02:00
alias_case.tests ash: parser: Fix alias expansion after heredoc or newlines 2021-09-08 01:43:12 +02:00
alias.right small ash testsuite, adapted from bash 2007-03-05 00:27:50 +00:00
alias.tests small ash testsuite, adapted from bash 2007-03-05 00:27:50 +00:00