aboutsummaryrefslogtreecommitdiff
path: root/src/configparser.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2023-07-12 23:37:59 +0100
committerGravatar Sadie Powell2023-07-12 23:37:59 +0100
commit45885df22c5f11d1b2327c2fe5244d4d50d01ebb (patch)
tree3361962de2d31e14b1e0e3f3dbe1d4bd3b0dac72 /src/configparser.cpp
parentDefine _BSD_SOURCE when building on Haiku. (diff)
Fix parsing end-of-file comments that don't end with a newline.
Diffstat (limited to 'src/configparser.cpp')
-rw-r--r--src/configparser.cpp8
1 files changed, 7 insertions, 1 deletions
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;
+ }
}
}