diff --git a/apps/registrar_client/ContactInfo.cpp b/apps/registrar_client/ContactInfo.cpp index 06c5b2a4..be6828d3 100644 --- a/apps/registrar_client/ContactInfo.cpp +++ b/apps/registrar_client/ContactInfo.cpp @@ -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; }