Fix invalid parsing of line with keyword end tag and comment

* Add error text when size differs
* #9845: Remove invalid parsing of data in comment line
The line '/ -- 123 123' was parsed incorrectly, and values 123 123 was added to the list of valid values for the keyword.
This commit is contained in:
Magne Sjaastad authored and GitHub committed 2023-02-16 13:04:16 +01:00
1 parent 20439e1da9
commit edbeb4dfb1
5 files changed
+46 -12

No files matched your search

@@ -147,6 +147,13 @@ std::pair<std::string, std::vector<float>>
continue;
}
// End of keyword is defined by '/', parse values of line until '/' is found
auto positionOfEndToken = line.find_first_of( '/' );
if ( positionOfEndToken != std::string::npos )
{
line = line.substr( 0, positionOfEndToken );
}
if ( !isEndTokenKeywordRead )
{
size_t start = 0;
@@ -186,8 +193,7 @@ std::pair<std::string, std::vector<float>>
}
}
// End of keyword is defined by '/'
if ( line.find_first_of( '/' ) != std::string::npos )
if ( positionOfEndToken != std::string::npos )
{
isEndTokenKeywordRead = true;
continue;