summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/parser.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/parser.c b/src/parser.c
index ae76400..6a8a4a4 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -924,7 +924,8 @@ readtoken1(int firstc, char const *syntax, char *eofmark, int striptabs)
 			CHECKSTRSPACE(4, out);	/* permit 4 calls to USTPUTC */
 			switch(synstack->syntax[c]) {
 			case CNL:	/* '\n' */
-				if (synstack->syntax == BASESYNTAX)
+				if (synstack->syntax == BASESYNTAX &&
+				    !synstack->varnest)
 					goto endword;	/* exit outer loop */
 				USTPUTC(c, out);
 				nlprompt();