1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-21 00:19:29 +02:00

Fix pasring csv cells with multiple quoted parts

This commit is contained in:
AlexVinS
2015-09-12 23:03:10 +03:00
parent e9c3bc9df6
commit f310be5d5f

View File

@ -206,12 +206,24 @@ std::string CLegacyConfigParser::extractQuotedString()
{
ret += extractQuotedPart();
// double quote - add it to string and continue unless
// line terminated using tabulation
if (curr < end && *curr == '\"' && *curr != '\t')
// double quote - add it to string and continue quoted part
if (curr < end && *curr == '\"')
{
ret += '\"';
}
//extract normal part
else if(curr < end && *curr != '\t' && *curr != '\r')
{
char * begin = curr;
while (curr < end && *curr != '\t' && *curr != '\r' && *curr != '\"')//find end of string or next quoted part start
curr++;
ret += std::string(begin, curr);
if(curr>=end || *curr != '\"')
return ret;
}
else // end of string
return ret;
}