[Asterisk-cvs] asterisk config.c,1.26,1.27

markster at lists.digium.com markster at lists.digium.com
Fri Sep 3 11:33:07 CDT 2004


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

Modified Files:
	config.c 
Log Message:
Fix escaping ;  (bug #2368)


Index: config.c
===================================================================
RCS file: /usr/cvsroot/asterisk/config.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- config.c	8 Aug 2004 22:22:30 -0000	1.26
+++ config.c	3 Sep 2004 15:36:13 -0000	1.27
@@ -455,13 +455,19 @@
 	int object;
 	/* Strip off lines using ; as comment */
 	c = strchr(buf, ';');
-	if (c) {
-		*c = '\0';
+	while (c) {
+		if ((c == buf) || (*(c-1) != '\\')) {
+			*c = '\0';
 #ifdef PRESERVE_COMMENTS
-		c++;
-		if (*c != '!')
-			com = build_comment(c);
+			c++;
+			if (*c != '!')
+				com = build_comment(c);
 #endif			
+		} else {
+			*(c-1) = ';';
+			memmove(c, c + 1, strlen(c + 1));
+		}
+		c = strchr(c + 1, ';');
 	}
 	cur = strip(buf);
 	if (!ast_strlen_zero(cur)) {




More information about the svn-commits mailing list