From: Kevin P. Fleming Date: Mon, 20 Jun 2005 17:01:03 +0000 (+0000) Subject: fix reply_digest breakage from earlier patch X-Git-Tag: 1.2.0-beta1~436 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a752aeb4e898ca93b5b319675f79caccf89f6436;p=thirdparty%2Fasterisk.git fix reply_digest breakage from earlier patch git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5941 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 2214022347..31391c4d24 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -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 */