From 45885df22c5f11d1b2327c2fe5244d4d50d01ebb Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Wed, 12 Jul 2023 23:37:59 +0100 Subject: Fix parsing end-of-file comments that don't end with a newline. --- src/configparser.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/configparser.cpp') diff --git a/src/configparser.cpp b/src/configparser.cpp index 8fe3d082f..f193cb7d8 100644 --- a/src/configparser.cpp +++ b/src/configparser.cpp @@ -163,9 +163,15 @@ struct Parser { while (1) { - int ch = next(); + int ch = next(true); if (ch == '\n') return; + + if (ch == EOF) + { + unget(ch); + return; + } } } -- cgit v1.3.1-10-gc9f91