summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ChangeLog4
-rw-r--r--src/parser.c10
2 files changed, 12 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 670682b..cf56c9a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-09-26  Herbert Xu <herbert@gondor.apana.org.au>
+
+	* Recognise here-doc delimiters terminated by EOF.
+
 2007-09-26  Roy Marples <uberlord@gentoo.org>
 
 	* Refresh stack pointers after makestrspace in _rmescapes.
diff --git a/src/parser.c b/src/parser.c
index 1a483d4..cac0aa5 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -1049,8 +1049,14 @@ checkend: {
 				char *p, *q;
 
 				p = line;
-				for (q = eofmark + 1 ; *q && *p == *q ; p++, q++);
-				if (*p == '\n' && *q == '\0') {
+				for (q = eofmark + 1;; p++, q++) {
+					c = *p;
+					if (c == '\n')
+						c = 0;
+					if (!*q || c != *q)
+						break;
+				}
+				if (c == *q) {
 					c = PEOF;
 					plinno++;
 					needprompt = doprompt;
June McEnroe 2017-10-03Simplify Makefile with pattern ruleJune McEnroe 2017-09-27Remove leading blank linesJune McEnroe 2017-09-27Add merge.c to READMEJune McEnroe 2017-09-03Assert client coords are valid after movementJune McEnroe 2017-09-03Relicense AGPLJune McEnroe 2017-09-01Revert "Add client readOnly mode"June McEnroe 2017-09-01Remove clientRemove call from clientCastJune McEnroe 2017-09-01Add client readOnly modeJune McEnroe 2017-08-31Clean up merge toolJune McEnroe 2017-08-31Choose B for tiles with equal modify timesJune McEnroe 2017-08-31Add quick data file merge toolJune McEnroe 2017-08-30Use only foreground color for selecting spawnJune McEnroe 2017-08-29Add four additional spawnsJune McEnroe 2017-08-28Add respawningJune McEnroe 2017-08-26Move license above includesJune McEnroe 2017-08-26Snapshot metadataJune McEnroe 2017-08-26Add meta.c to READMEJune McEnroe 2017-08-26Use MakefileJune McEnroe