summary refs log tree commit diff
path: root/src/alias.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2020-04-29 00:19:59 +1000
committerHerbert Xu <herbert@gondor.apana.org.au>2020-05-15 16:24:38 +1000
commit07951cfffb218291e7574b874660eab652cb54f1 (patch)
treeba85a61937b42600400e9fb7a78e0181ce627fb9 /src/alias.h
parentparser: Catch errors in expandstr (diff)
downloaddash-07951cfffb218291e7574b874660eab652cb54f1.tar.gz
dash-07951cfffb218291e7574b874660eab652cb54f1.zip
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.

Suggested-by: Harald van Dijk <harald@gigawatt.nl>
Reported-by: Harald van Dijk <harald@gigawatt.nl>
Reported-by: Martijn Dekker <martijn@inlv.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions
span title='2020-08-30 14:42:11 -0400'>2020-08-30Rearrange bounce.c, move non-main mains below mainJune McEnroe 2020-08-30Sandbox pounce with unveil(2)June McEnroe 2020-08-28Refactor certificate loading and load all certs from config pathsJune McEnroe 2020-08-27Sandbox pounce with pledge(2)June McEnroe 2020-08-27Sandbox calico with pledge(2) and unveil(2)June McEnroe 2020-08-27Add support for OpenBSDJune McEnroe 2020-08-27Remove rc scriptsJune McEnroe 2020-08-27contrib/palaver: Fix documented database pathJune McEnroe 2020-08-27contrib/palaver: Remove rc scriptJune McEnroe 2020-08-27contrib/palaver: Fix database search and creationJune McEnroe 2020-08-27contrib/palaver: Use pounce's XDG directoryJune McEnroe 2020-08-27contrib/palaver: Only allow HTTPSJune McEnroe 2020-08-25Support the pounce_env rc variableJune McEnroe 2020-08-25Remove deprecated option namesJune McEnroe 2020-08-25Document configuration and data file searchJune McEnroe 2020-08-24Use dataOpen for save fileJune McEnroe 2020-08-24Use configOpen to load localCAJune McEnroe 2020-08-24Use configPath to load client cert/privJune McEnroe 2020-08-24Use configOpen in getopt_configJune McEnroe 2020-08-24Import xdg.c from catgirlJune McEnroe 2020-08-23Replace “RAND_bytes” by “getentropy”Issam E. Maghni 2020-08-16contrib/palaver: Add no message preview flagsJune McEnroe 2020-08-13contrib/palaver: Don't set channel for PMsJune McEnroe 2020-08-13Fix unintended interception of NICK after registrationJune McEnroe 2020-08-12Add Additional Components section to READMEJune McEnroe 2020-08-12Document -L / palaver optionJune McEnroe 2020-08-11contrib/palaver: Document service configurationJune McEnroe 2020-08-11contrib/palaver: Add install target and rc scriptJune McEnroe 2020-08-11contrib/palaver: Implement command and notificationsJune McEnroe