Support for non-quoted descriptive names: Some Name <uri>

git-svn-id: http://voip.null.ro/svn/yate@587 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2005-11-24 19:40:45 +00:00
parent 2b0e22ac6d
commit a893f4a8d6

View file

@ -148,8 +148,15 @@ void URI::parse() const
// the compiler generates wrong code so use the temporary
String tmp(*this);
bool hasDesc = false;
Regexp r("^[[:space:]]*\"\\([^\"]\\+\\)\"[[:space:]]*\\(.*\\)$");
if (tmp.matches(r)) {
if (tmp.matches(r))
hasDesc = true;
else {
r = "^[[:space:]]*\\([^<]\\+\\)[[:space:]]*<\\([^>]\\+\\)";
hasDesc = tmp.matches(r);
}
if (hasDesc) {
m_desc = tmp.matchString(1);
tmp = tmp.matchString(2);
*const_cast<URI*>(this) = tmp;