fixed SEMS-9: bug preventing the last parameter to be extracted correctly from contact

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@386 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Stefan Sayer 19 years ago
parent e2818b87e7
commit 7d47e34e5e

@ -269,12 +269,15 @@ bool ContactInfo::parse_params(string& line, int& pos) {
size_t p1=pos, p2=pos;
int st = 0; int quoted = false;
char last_c = ' ';
bool hit_comma = false;
params.clear();
while((size_t)pos < line.length()) {
char c = line[pos];
if (!quoted) {
if (c == ',')
if (c == ',') {
hit_comma = true;
break;
}
if (c == '\"') {
quoted = 1;
} else if (c == '=') {
@ -299,9 +302,12 @@ bool ContactInfo::parse_params(string& line, int& pos) {
pos++;
}
if (st == pS2)
params[line.substr(p1, p2-p1)] = line.substr(p2+1, pos-p2);
if (st == pS2) {
if (hit_comma)
params[line.substr(p1, p2-p1)] = line.substr(p2+1, pos-p2 -1);
else
params[line.substr(p1, p2-p1)] = line.substr(p2+1, pos-p2);
}
return true;
}

Loading…
Cancel
Save