From 89bb665d75e908d6abaa29c44049ca9256ff1ccf Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Sat, 20 Jun 2015 05:31:43 -0400 Subject: [PATCH] fail if invalid content after "end" in prm Instead of ignoring all content after "end" in a prm file, generate a parser error. --- source/base/parameter_handler.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/source/base/parameter_handler.cc b/source/base/parameter_handler.cc index fa519d059d..d25b6f92a5 100644 --- a/source/base/parameter_handler.cc +++ b/source/base/parameter_handler.cc @@ -2574,6 +2574,18 @@ ParameterHandler::scan_line (std::string line, if ((line.find ("END") == 0) || (line.find ("end") == 0)) { + line.erase (0, 3); + while ((line.size() > 0) && (line[0] == ' ')) + line.erase (0, 1); + + if (line.size()>0) + { + std::cerr << "Line <" << lineno + << "> of file <" << input_filename + << ">: invalid content after 'end'!" << std::endl; + return false; + } + if (subsection_path.size() == 0) { std::cerr << "Line <" << lineno -- 2.39.5