fix reply_digest breakage from earlier patch

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5941 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming 2005-06-20 17:01:03 +00:00
parent f80df76143
commit a752aeb4e8
1 changed files with 7 additions and 12 deletions

View File

@ -7772,29 +7772,24 @@ static int reply_digest(struct sip_pvt *p, struct sip_request *req,
i->dst[0] = '\0'; /* init all to empty strings */
while (c && *(c = ast_skip_blanks(c))) { /* lookup for keys */
for (i = keys; i->key != NULL; i++) {
char *src;
char *src, *separator;
if (strncasecmp(c, i->key, strlen(i->key)) != 0)
continue;
/* Found. Skip keyword, take text in quotes or up to the separator. */
c += strlen(i->key);
if ((*c == '\"')) {
if (*c == '\"') {
src = ++c;
if ((c = strchr(c,'\"'))) {
*c = '\0';
c++;
}
separator = "\"";
} else {
src = c;
if ((c = strchr(c,','))) {
*c = '\0';
c++;
}
separator = ",";
}
strsep(&c, separator); /* clear separator and move ptr */
ast_copy_string(i->dst, src, i->dstlen);
break;
}
if (i->key == NULL)
c = strchr(c,',');
if (i->key == NULL) /* not found, try ',' */
strsep(&c, ",");
}
/* Save auth data for following registrations */