summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/parser.c10
1 files changed, 8 insertions, 2 deletions
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;