summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y4
1 files changed, 4 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index 311bbba80b..a35b526ab3 100644
--- a/parse.y
+++ b/parse.y
@@ -6015,6 +6015,10 @@ nextline(struct parser_params *p)
if (p->eofp)
return -1;
+ if (p->lex.pend > p->lex.pbeg && *(p->lex.pend-1) != '\n') {
+ goto end_of_input;
+ }
+
if (!p->lex.input || NIL_P(v = lex_getline(p))) {
end_of_input:
p->eofp = 1;