1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-03 14:52:11 +02:00

JsonParser::error(): Don't add trailing newline

This commit is contained in:
Alexander Wilms 2024-07-15 23:58:56 +02:00
parent 6f5710e809
commit 466318b77b

View File

@ -587,7 +587,12 @@ bool JsonParser::error(const std::string & message, bool warning)
std::ostringstream stream;
std::string type(warning ? " warning: " : " error: ");
stream << "At line " << lineCount << ", position " << pos - lineStart << type << message << "\n";
if(errors != "")
{
// only add the line breaks between error messages so we don't have a trailing line break
stream << "\n";
}
stream << "At line " << lineCount << ", position " << pos - lineStart << type << message;
errors += stream.str();
return warning;