1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +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(); ret += extractQuotedPart();
// double quote - add it to string and continue unless // double quote - add it to string and continue quoted part
// line terminated using tabulation if (curr < end && *curr == '\"')
if (curr < end && *curr == '\"' && *curr != '\t')
{ {
ret += '\"'; 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 else // end of string
return ret; return ret;
} }