mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-15 01:42:13 -05:00
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:
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;
|
||||
|
||||
Reference in new issue
Block a user