From ec2c84d3c4dba4b74440d72bdd1de416a9acd2a9 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Tue, 15 Mar 2011 17:41:53 +0800 Subject: [PARSER] Fix clobbering of checkkwd On Sun, Nov 07, 2010 at 02:21:21AM +0000, Jonathan Nieder wrote: > > Just ran into some strange behavior: > > $ cat test.sh > #!/bin/sh > echo hello >greeting > cat < $(cat greeting) > EOF > { > echo $? > cat greeting > } >/dev/null > > > $ sh test.sh > hello > test.sh: 7: {: not found > 127 > hello > test.sh: 10: Syntax error: "}" unexpected > > bash, mksh, pdksh, and ksh93 all print hello as expected. The problem > is reproducible with all versions of dash in the git repo. This is caused by the clobbering of checkkwd due to readtoken recursion while parsing a here document. This patch fixes it by saving the original value of checkkwd. Reported-by: Jonathan Nieder Signed-off-by: Herbert Xu --- ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 5b6d53e..50a8044 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-03-15 Herbert Xu + + * Fix clobbering of checkkwd. + 2011-03-15 Jonathan Nieder * Free IFS state after here document expansion. -- cgit 1.4.1