summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ChangeLog4
-rw-r--r--src/parser.c5
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 5b6d53e..50a8044 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-03-15  Herbert Xu <herbert@gondor.apana.org.au>
+
+	* Fix clobbering of checkkwd.
+
 2011-03-15  Jonathan Nieder <jrnieder@gmail.com>
 
 	* Free IFS state after here document expansion.
diff --git a/src/parser.c b/src/parser.c
index 0bfd620..528d005 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -687,6 +687,7 @@ STATIC int
 readtoken(void)
 {
 	int t;
+	int kwd = checkkwd;
 #ifdef DEBUG
 	int alreadyseen = tokpushback;
 #endif
@@ -697,7 +698,7 @@ top:
 	/*
 	 * eat newlines
 	 */
-	if (checkkwd & CHKNL) {
+	if (kwd & CHKNL) {
 		while (t == TNL) {
 			parseheredoc();
 			t = xxreadtoken();
@@ -711,7 +712,7 @@ top:
 	/*
 	 * check for keywords
 	 */
-	if (checkkwd & CHKKWD) {
+	if (kwd & CHKKWD) {
 		const char *const *pp;
 
 		if ((pp = findkwd(wordtext))) {