summaryrefslogtreecommitdiff
path: root/src/config.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.cpp')
-rw-r--r--src/config.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/config.cpp b/src/config.cpp
index dc8586d46..8447a8a16 100644
--- a/src/config.cpp
+++ b/src/config.cpp
@@ -942,5 +942,10 @@ void Conf::LoadConf(File &file)
if (!itemname.empty() || !wordbuffer.empty())
throw ConfigException("Unexpected garbage at end of file: " + file.GetName());
if (!block_stack.empty())
- throw ConfigException("Unterminated block at end of file: " + file.GetName() + ". Block was opened on line " + stringify(block_stack.top()->linenum));
+ {
+ if (block_stack.top())
+ throw ConfigException("Unterminated block at end of file: " + file.GetName() + ". Block was opened on line " + stringify(block_stack.top()->linenum));
+ else
+ throw ConfigException("Unterminated commented block at end of file: " + file.GetName());
+ }
}