[asterisk-commits] tilghman: branch 1.4 r272921 - /branches/1.4/main/config.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jun 28 16:29:32 CDT 2010


Author: tilghman
Date: Mon Jun 28 16:29:27 2010
New Revision: 272921

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=272921
Log:
Change the way that we read include files, to accommodate for changes in GCC 4.4.

(closes issue #17472)
 Reported by: seandarcy
 Patches: 
       config2.patch uploaded by nivan (license 1066)
 Tested by: nivan

Modified:
    branches/1.4/main/config.c

Modified: branches/1.4/main/config.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/main/config.c?view=diff&rev=272921&r1=272920&r2=272921
==============================================================================
--- branches/1.4/main/config.c (original)
+++ branches/1.4/main/config.c Mon Jun 28 16:29:27 2010
@@ -726,20 +726,13 @@
 			if (c) {
 				cur = c;
 				/* Strip off leading and trailing "'s and <>'s */
-				if (*c == '"') {
-					/* Dequote */
-					while (*c) {
-						if (*c == '"') {
-							strcpy(c, c + 1); /* SAFE */
-							c--;
-						} else if (*c == '\\') {
-							strcpy(c, c + 1); /* SAFE */
-						}
-						c++;
+				if ((*c == '"') || (*c == '<')) {
+					char quote_char = *c;
+					if (quote_char == '<') {
+						quote_char = '>';
 					}
-				} else if (*c == '<') {
-					/* C-style include */
-					if (*(c + strlen(c) - 1) == '>') {
+
+					if (*(c + strlen(c) - 1) == quote_char) {
 						cur++;
 						*(c + strlen(c) - 1) = '\0';
 					}




More information about the asterisk-commits mailing list