[Asterisk-cvs] asterisk/channels chan_sip.c,1.765,1.766

kpfleming at lists.digium.com kpfleming at lists.digium.com
Mon Jun 20 13:00:08 CDT 2005


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv31924/channels

Modified Files:
	chan_sip.c 
Log Message:
fix reply_digest breakage from earlier patch


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.765
retrieving revision 1.766
diff -u -d -r1.765 -r1.766
--- chan_sip.c	19 Jun 2005 22:00:18 -0000	1.765
+++ chan_sip.c	20 Jun 2005 17:01:03 -0000	1.766
@@ -7772,29 +7772,24 @@
 		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 */




More information about the svn-commits mailing list